use doAssert in tests (#16486)

This commit is contained in:
flywind 2020-12-28 07:13:21 -06:00 • committed by GitHub
commit 6d442a40a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 1056 additions and 1056 deletions

View file

@ -5,9 +5,9 @@ proc doubleSleep(hardSleep: int) {.async.} =
sleep(hardSleep)
template assertTime(target, timeTook: float): untyped {.dirty.} =
assert(timeTook*1000 > target - 1000, "Took too short, should've taken " &
doAssert(timeTook*1000 > target - 1000, "Took too short, should've taken " &
$target & "ms, but took " & $(timeTook*1000) & "ms")
assert(timeTook*1000 < target + 1000, "Took too long, should've taken " &
doAssert(timeTook*1000 < target + 1000, "Took too long, should've taken " &
$target & "ms, but took " & $(timeTook*1000) & "ms")
var