Support Nim 1.2.x

This commit is contained in:
Mark Spanbroek 2022-07-05 17:20:01 +02:00 committed by markspanbroek
parent 3aaa852b43
commit 3818ada4f5

View File

@ -1,4 +1,9 @@
import std/exitprocs
template tryImport(module) = import module
when compiles tryImport std/exitprocs:
import std/exitprocs
else:
template getProgramResult: auto = programResult
template setProgramResult(value) = programResult = value
template silent(body) =
@ -25,4 +30,5 @@ suite "reports unhandled exception when teardown handles exceptions too":
discard
test "should fail, but not crash":
raise newException(ValueError, "This exception is expected")
if true:
raise newException(ValueError, "This exception is expected")