summary refs log tree commit diff stats
path: root/tests/cpp/tcppraise.nim
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2018-02-22 08:58:56 +0000
committerAndreas Rumpf <rumpf_a@web.de>2018-02-22 09:58:56 +0100
commit45d3e2e51088f0943fdffe59c60b05f14abac26c (patch)
tree81614eee0513efb05db52c5ee22d9b817fdf55cc /tests/cpp/tcppraise.nim
parent0cf207a452f981aef56ccab4555f235d57da9dc4 (diff)
downloadNim-45d3e2e51088f0943fdffe59c60b05f14abac26c.tar.gz
genTryCpp codegen. Fixes #7232. Fixes #7239 (#7240)
Diffstat (limited to 'tests/cpp/tcppraise.nim')
-rw-r--r--tests/cpp/tcppraise.nim22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/cpp/tcppraise.nim b/tests/cpp/tcppraise.nim
index 7db9c0cfa..f359a2e8b 100644
--- a/tests/cpp/tcppraise.nim
+++ b/tests/cpp/tcppraise.nim
@@ -3,7 +3,9 @@ discard """
   output: '''foo
 bar
 Need odd and >= 3 digits##
-baz'''
+baz
+caught
+'''
 """
 
 # bug #1888
@@ -15,3 +17,21 @@ try:
 except ValueError:
   echo getCurrentExceptionMsg(), "##"
 echo "baz"
+
+
+# bug 7232
+try:
+ discard
+except KeyError, ValueError:
+  echo "except handler" # should not be invoked
+
+
+#bug 7239
+try:
+  try:
+    raise newException(ValueError, "asdf")
+  except KeyError, ValueError:
+    raise
+except:
+  echo "caught"
+