fix stand-alone "check" for <Nim-1.4.0

and prevent a theoretical integer overflow
This commit is contained in:
Ștefan Talpalaru 2021-03-22 20:01:37 +01:00
parent 06063acac7
commit 72a6ae5ce6
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
2 changed files with 6 additions and 2 deletions

View File

@ -177,3 +177,7 @@ when defined(testing):
check false == matchFilter("suite1", "foo", "*ite2::")
check matchFilter("suite1", "q**we::foo", "q**we::foo")
check matchFilter("suite1", "a::b*c::d*e", "a::b*c::d*e")
# Also supposed to work outside tests:
check 1 == 1

View File

@ -687,7 +687,7 @@ template test*(name, body) =
finally:
if testStatusIMPL == TestStatus.FAILED:
programResult += 1
programResult = 1
let testResult = TestResult(
suiteName: testSuiteName,
testName: name,
@ -734,7 +734,7 @@ template fail* =
when declared(testStatusIMPL):
testStatusIMPL = TestStatus.FAILED
else:
setProgramResult 1
programResult = 1
ensureInitialized()