diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-11-12 02:25:41 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 09:25:41 +0100 |
commit | e5db5316c2101a27efd744ba10126fdb57a7eb7c (patch) | |
tree | 54b7662b4d509616803306db14b9b44f52d29968 /tests | |
parent | 1f9bf43100f7236d8ccbcaa14c43bc18f7e6e5d8 (diff) | |
download | Nim-e5db5316c2101a27efd744ba10126fdb57a7eb7c.tar.gz |
doAssertRaises improvements; nimscript supports `except Exception as e` (#15765)
* doAssertRaises now correctly handles foreign exceptions; now shows which exception is raised on mismatch * nimscript now handles `Exception as e` * remove catch-all doAssertRaises overload from this PR Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_nimscript.nims | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_nimscript.nims b/tests/test_nimscript.nims index b94146b1e..ea640cac6 100644 --- a/tests/test_nimscript.nims +++ b/tests/test_nimscript.nims @@ -81,3 +81,9 @@ block: # #14142 discard dirExists("/usr") discard fileExists("/usr/foo") discard findExe("nim") + +block: + doAssertRaises(AssertionDefect): doAssert false + try: doAssert false + except Exception as e: + discard |