From 3818ada4f557f488f7fca8ab5fcf5e54df17c99e Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Tue, 5 Jul 2022 17:20:01 +0200 Subject: [PATCH] Support Nim 1.2.x --- testmodules/stdlib/testfail.nim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/testmodules/stdlib/testfail.nim b/testmodules/stdlib/testfail.nim index 0c54d68..ed4b390 100644 --- a/testmodules/stdlib/testfail.nim +++ b/testmodules/stdlib/testfail.nim @@ -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")