summary refs log tree commit diff stats
path: root/tests/exception/t18620.nim
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-08-01 17:19:43 +0800
committerGitHub <noreply@github.com>2021-08-01 11:19:43 +0200
commit916d0c21af6153338a8064ff953b579ff87c6ba6 (patch)
tree8a1953628a6ef1f8e5af13a35b6c025827c38461 /tests/exception/t18620.nim
parent52e276c82daf2b8a33f4e4304eac3074bb37b70d (diff)
downloadNim-916d0c21af6153338a8064ff953b579ff87c6ba6.tar.gz
fix #18620 (#18624)
* fix #18620

* add testcase
Diffstat (limited to 'tests/exception/t18620.nim')
-rw-r--r--tests/exception/t18620.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/exception/t18620.nim b/tests/exception/t18620.nim
new file mode 100644
index 000000000..ee23f8bac
--- /dev/null
+++ b/tests/exception/t18620.nim
@@ -0,0 +1,17 @@
+discard """
+  matrix: "--gc:arc; --gc:refc"
+"""
+
+proc hello() =
+  raise newException(ValueError, "You are wrong")
+
+var flag = false
+
+try:
+  hello()
+except ValueError as e:
+  flag = true
+  doAssert len(getStackTraceEntries(e)) > 0
+  doAssert len(getStackTraceEntries(e)) > 0
+
+doAssert flag