summary refs log tree commit diff stats
path: root/tests/accept/run
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2010-09-13 00:52:44 +0200
committerAraq <rumpf_a@web.de>2010-09-13 00:52:44 +0200
commit866572e2e4601a1248e5ac78b151dc48fb483aa4 (patch)
treef38b3574eb66ed398d176175564eeb264bd96376 /tests/accept/run
parent030d46f21804d8dd82edf7d5d2875e8f034dd86a (diff)
downloadNim-866572e2e4601a1248e5ac78b151dc48fb483aa4.tar.gz
fixes for exception handling; added system.compileOption
Diffstat (limited to 'tests/accept/run')
-rw-r--r--tests/accept/run/tcontinuexc.nim21
-rwxr-xr-xtests/accept/run/toverflw2.nim5
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/accept/run/tcontinuexc.nim b/tests/accept/run/tcontinuexc.nim
new file mode 100644
index 000000000..97b190e3c
--- /dev/null
+++ b/tests/accept/run/tcontinuexc.nim
@@ -0,0 +1,21 @@
+type
+  ESomething = object of E_Base
+  ESomeOtherErr = object of E_Base
+
+proc genErrors(s: string) =
+  if s == "error!":
+    raise newException(ESomething, "Test")
+  else:
+    raise newException(EsomeotherErr, "bla")
+
+try:
+  for i in 0..3:
+    try:
+      genErrors("error!")
+    except ESomething:
+      echo("Error happened")
+    echo "came here"
+    raise newException(EsomeotherErr, "bla")
+finally:  
+  echo "caught"
+
diff --git a/tests/accept/run/toverflw2.nim b/tests/accept/run/toverflw2.nim
new file mode 100755
index 000000000..b54bda9fa
--- /dev/null
+++ b/tests/accept/run/toverflw2.nim
@@ -0,0 +1,5 @@
+var a : int32 = 2147483647
+var b : int32 = 2147483647
+var c = a + b
+
+