I always wondered why unittests used this idiom: discard """ ...""" + echo or write (eg: see [1]).
Instead the following should be used IMO except in rare cases where echo is needed:
import std/unittest
check: # or require if we want to stop running tests on this file on 1st error
expr1 == expected1
expr2 == expected2
..
benefits:
Recommendation:
[1] eg recent PR: 404f0d64afa5cb18c54c52d261609f60a00cdb46 tests/misc/tsizeof.nim:
discard """
file: "tsize.nim"
output: "40 3 12 32"
"""
write(stdout, sizeof(TMyRecord))
echo ' ', mysize1, ' ', mysize2, ' ',mysize3
doAssert doesn't behave as expected in koch tests for me: adding doAssert(false) at the top of tests/stdlib/tparsesql.nim and then running
./koch test run stdlib/tparsesql.nim
in the top directory of a Nim fork results in
PASS: tparsesql.nim C
This better be some flaw in my fork.