From 428b64251f19b95fe0f78689e7d97cb415c7deb6 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:30:54 +0800 Subject: [PATCH] adds a test case (#24532) closes #18070 (cherry picked from commit f796c01e3c2f61e16f3ef64093f638103e50ebf4) --- tests/arc/tarcmisc.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim index 1a4ffeddb0..d9cbb46403 100644 --- a/tests/arc/tarcmisc.nim +++ b/tests/arc/tarcmisc.nim @@ -861,3 +861,17 @@ block: var s = Foo() new(s, delete) + +proc test_18070() = # bug #18070 + try: + try: + raise newException(CatchableError, "something") + except: + raise newException(CatchableError, "something else") + except: + doAssert getCurrentExceptionMsg() == "something else" + + let msg = getCurrentExceptionMsg() + doAssert msg == "", "expected empty string but got: " & $msg + +test_18070()