diff options
author | Araq <rumpf_a@web.de> | 2010-09-13 00:52:44 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2010-09-13 00:52:44 +0200 |
commit | 866572e2e4601a1248e5ac78b151dc48fb483aa4 (patch) | |
tree | f38b3574eb66ed398d176175564eeb264bd96376 /tests/accept/run | |
parent | 030d46f21804d8dd82edf7d5d2875e8f034dd86a (diff) | |
download | Nim-866572e2e4601a1248e5ac78b151dc48fb483aa4.tar.gz |
fixes for exception handling; added system.compileOption
Diffstat (limited to 'tests/accept/run')
-rw-r--r-- | tests/accept/run/tcontinuexc.nim | 21 | ||||
-rwxr-xr-x | tests/accept/run/toverflw2.nim | 5 |
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 + + |