summary refs log tree commit diff stats
path: root/tests/cpp/tcppraise.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-04-27 23:11:36 +0200
committerAraq <rumpf_a@web.de>2015-04-27 23:11:59 +0200
commitc6398d408de89672d1df21ee84507978f2320ba8 (patch)
treedc2226977e14097049e6f1e694243dbd781a3c36 /tests/cpp/tcppraise.nim
parentb34bd3b16371ac05fd293a878976d6dd2326491c (diff)
downloadNim-c6398d408de89672d1df21ee84507978f2320ba8.tar.gz
fixes #1888
Diffstat (limited to 'tests/cpp/tcppraise.nim')
-rw-r--r--tests/cpp/tcppraise.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/cpp/tcppraise.nim b/tests/cpp/tcppraise.nim
new file mode 100644
index 000000000..a9ea8e6ce
--- /dev/null
+++ b/tests/cpp/tcppraise.nim
@@ -0,0 +1,17 @@
+discard """
+  cmd: "nim cpp $file"
+  output: '''foo
+bar
+Need odd and >= 3 digits##
+baz'''
+"""
+
+# bug #1888
+echo "foo"
+try:
+  echo "bar"
+  raise newException(ValueError, "Need odd and >= 3 digits")
+#  echo "baz"
+except ValueError:
+  echo getCurrentExceptionMsg(), "##"
+echo "baz"