Merge pull request #3172 from Nycto/devel
Unittest module: Fix multiple requires in a test
This commit is contained in:
commit
e2886eebb4
2 changed files with 6 additions and 1 deletions
|
|
@ -285,7 +285,7 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
|||
|
||||
result = getAst(rewrite(checked, checked.lineinfo, checked.toStrLit))
|
||||
|
||||
template require*(conditions: stmt): stmt {.immediate, dirty.} =
|
||||
template require*(conditions: stmt): stmt {.immediate.} =
|
||||
## Same as `check` except any failed test causes the program to quit
|
||||
## immediately. Any teardown statements are not executed and the failed
|
||||
## test output is not generated.
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ test "unittest typedescs":
|
|||
check(none(int) != some(1))
|
||||
|
||||
|
||||
test "unittest multiple requires":
|
||||
require(true)
|
||||
require(true)
|
||||
|
||||
|
||||
import math
|
||||
from strutils import parseInt
|
||||
proc defectiveRobot() =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue