Don't run non-test code when defined(testing)
This commit is contained in:
parent
d203d6fad4
commit
32109a7867
46 changed files with 104 additions and 82 deletions
|
|
@ -493,7 +493,8 @@ when isMainModule:
|
|||
block: # filter iterator test
|
||||
let numbers = @[1, 4, 5, 8, 9, 7, 4]
|
||||
for n in filter(numbers, proc (x: int): bool = x mod 2 == 0):
|
||||
echo($n)
|
||||
when not defined(testing):
|
||||
echo($n)
|
||||
# echoes 4, 8, 4 in separate lines
|
||||
|
||||
block: # keepIf test
|
||||
|
|
@ -616,4 +617,5 @@ when isMainModule:
|
|||
#doAssert a.repeat(-1) == @[] # will not compile!
|
||||
doAssert b.repeat(3) == @[]
|
||||
|
||||
echo "Finished doc tests"
|
||||
when not defined(testing):
|
||||
echo "Finished doc tests"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue