diff options
author | flywind <xzsflywind@gmail.com> | 2021-08-01 17:19:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-01 11:19:43 +0200 |
commit | 916d0c21af6153338a8064ff953b579ff87c6ba6 (patch) | |
tree | 8a1953628a6ef1f8e5af13a35b6c025827c38461 /tests/exception/t18620.nim | |
parent | 52e276c82daf2b8a33f4e4304eac3074bb37b70d (diff) | |
download | Nim-916d0c21af6153338a8064ff953b579ff87c6ba6.tar.gz |
fix #18620 (#18624)
* fix #18620 * add testcase
Diffstat (limited to 'tests/exception/t18620.nim')
-rw-r--r-- | tests/exception/t18620.nim | 17 |
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 |