diff options
author | Araq <rumpf_a@web.de> | 2012-02-17 20:19:14 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-02-17 20:19:14 +0100 |
commit | a13a14327ad1a98776bbd5646c18a4f6cf257029 (patch) | |
tree | 5d782b88f91a30e82daceb8232730342c8f91697 /tests | |
parent | 547e8aa418ee9a851a876e109b483fc987bd87df (diff) | |
download | Nim-a13a14327ad1a98776bbd5646c18a4f6cf257029.tar.gz |
fixes #99
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/texcpt1.nim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/run/texcpt1.nim b/tests/run/texcpt1.nim new file mode 100644 index 000000000..ec74c9470 --- /dev/null +++ b/tests/run/texcpt1.nim @@ -0,0 +1,30 @@ +discard """ + outputsub: "-6" +""" +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") + +proc raiseBla(): int = + try: + genErrors("errssor!") + except ESomething: + echo("Error happened") + except: + raise + +proc blah(): int = + try: + result = raiseBla() + except ESomeOtherErr: + result = -6 + +echo blah() + + |