diff options
Diffstat (limited to 'tests/exception/tsetexceptions.nim')
-rw-r--r-- | tests/exception/tsetexceptions.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/exception/tsetexceptions.nim b/tests/exception/tsetexceptions.nim new file mode 100644 index 000000000..0e353f43e --- /dev/null +++ b/tests/exception/tsetexceptions.nim @@ -0,0 +1,11 @@ +discard """ + targets: "c cpp js" + joinable: false +""" + +# refs https://github.com/nim-lang/Nim/pull/18247#issuecomment-860877161 + +let ex = newException(CatchableError, "test") +setCurrentException(ex) +doAssert getCurrentException().msg == ex.msg +doAssert getCurrentExceptionMsg() == ex.msg |