mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 18:32:11 +00:00
Merge pull request #3172 from Nycto/devel
Unittest module: Fix multiple requires in a test
This commit is contained in:
@@ -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() =
|
||||
|
||||
Reference in New Issue
Block a user