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:
parent
6b7a6f8c54
commit
4f10dde64a
1 changed files with 2 additions and 1 deletions
|
|
@ -344,7 +344,8 @@ tests so they'll be enabled even with `--assertions:off`.
|
||||||
doAssert foo() # preferred
|
doAssert foo() # preferred
|
||||||
|
|
||||||
.. _runnableExamples_use_assert:
|
.. _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
|
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
|
`runnableExamples`, but `nim doc --doccmd:-d:danger main` would, and so would the
|
||||||
second example below:
|
second example below:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue