summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-11-12 02:25:41 -0600
committerGitHub <noreply@github.com>2020-11-12 09:25:41 +0100
commite5db5316c2101a27efd744ba10126fdb57a7eb7c (patch)
tree54b7662b4d509616803306db14b9b44f52d29968 /tests
parent1f9bf43100f7236d8ccbcaa14c43bc18f7e6e5d8 (diff)
downloadNim-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.nims6
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