followup #17077: also use assert instead of doAssert for code-block rst blocks intended to be used as runnableExamples (#17122)

This commit is contained in:
Timothee Cour
2021-02-21 07:44:32 -08:00
committed by GitHub
parent 6b7a6f8c54
commit 4f10dde64a

View File

@@ -344,7 +344,8 @@ tests so they'll be enabled even with `--assertions:off`.
doAssert foo() # preferred
.. _runnableExamples_use_assert:
An exception to the above rule is `runnableExamples`, which for brevity use `assert`
An exception to the above rule is `runnableExamples` and `code-block` rst blocks
intended to be used as `runnableExamples`, which for brevity use `assert`
instead of `doAssert`. Note that `nim doc -d:danger main` won't pass `-d:danger` to the
`runnableExamples`, but `nim doc --doccmd:-d:danger main` would, and so would the
second example below: