Closed metagn closed 4 years ago
@kazk I found a way to reproduce this: whenever check
is called inside another function called inside test
block this happens. For instance:
Code:
proc multiply*(a, b: int): int = a + b
Test:
proc testing(a: int, b: int) = check(a == b)
suite "multiply":
test "multiply(1, 1)":
check(multiply(1, 1) == 1)
test "multiply(1, 2)":
testing(multiply(1, 2), 2)
Result:
However, the exit code would still be non-zero anyway so this cannot be used to bypass the test cases.
Oh, so there's no way to easily use wrap testing inside another procedure. Guess I'll have to actually rewrite the test code then.
Describe the bug
When using check(), Nim checks are counted as passing instead of failing even when they're wrong.
To Reproduce
Do check(false) in Nim and check the test results
Expected Behavior
It should be shown as a failure
Screenshots