From e5db5316c2101a27efd744ba10126fdb57a7eb7c Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 12 Nov 2020 02:25:41 -0600 Subject: 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 --- tests/test_nimscript.nims | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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 -- cgit 1.4.1-2-gfad0