Fix multiple requires in a test
This commit is contained in:
parent
1b4116702b
commit
eac484167c
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))
|
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
|
## Same as `check` except any failed test causes the program to quit
|
||||||
## immediately. Any teardown statements are not executed and the failed
|
## immediately. Any teardown statements are not executed and the failed
|
||||||
## test output is not generated.
|
## test output is not generated.
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@ test "unittest typedescs":
|
||||||
check(none(int) != some(1))
|
check(none(int) != some(1))
|
||||||
|
|
||||||
|
|
||||||
|
test "unittest multiple requires":
|
||||||
|
require(true)
|
||||||
|
require(true)
|
||||||
|
|
||||||
|
|
||||||
import math
|
import math
|
||||||
from strutils import parseInt
|
from strutils import parseInt
|
||||||
proc defectiveRobot() =
|
proc defectiveRobot() =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue