diff options
Diffstat (limited to 'tests/exception')
-rw-r--r-- | tests/exception/texcpt1.nim | 4 | ||||
-rw-r--r-- | tests/exception/tnestedreturn.nim | 10 | ||||
-rw-r--r-- | tests/exception/tnestedreturn2.nim | 10 | ||||
-rw-r--r-- | tests/exception/tunhandledexc.nim | 6 | ||||
-rw-r--r-- | tests/exception/twrongexc.nim | 6 |
5 files changed, 18 insertions, 18 deletions
diff --git a/tests/exception/texcpt1.nim b/tests/exception/texcpt1.nim index ec74c9470..50a95eeec 100644 --- a/tests/exception/texcpt1.nim +++ b/tests/exception/texcpt1.nim @@ -2,8 +2,8 @@ discard """ outputsub: "-6" """ type - ESomething = object of E_Base - ESomeOtherErr = object of E_Base + ESomething = object of Exception + ESomeOtherErr = object of Exception proc genErrors(s: string) = if s == "error!": diff --git a/tests/exception/tnestedreturn.nim b/tests/exception/tnestedreturn.nim index b9f7843f6..591638f0e 100644 --- a/tests/exception/tnestedreturn.nim +++ b/tests/exception/tnestedreturn.nim @@ -10,8 +10,8 @@ proc test1() = finally: echo "A" try: - raise newException(EOS, "Problem") - except EOS: + raise newException(OSError, "Problem") + except OSError: return test1() @@ -23,7 +23,7 @@ proc test2() = try: return - except EOS: + except OSError: discard test2() @@ -31,8 +31,8 @@ test2() proc test3() = try: try: - raise newException(EOS, "Problem") - except EOS: + raise newException(OSError, "Problem") + except OSError: return finally: echo "C" diff --git a/tests/exception/tnestedreturn2.nim b/tests/exception/tnestedreturn2.nim index 14a2dab92..4bd2d535d 100644 --- a/tests/exception/tnestedreturn2.nim +++ b/tests/exception/tnestedreturn2.nim @@ -1,14 +1,14 @@ discard """ - file: "tnestedreturn.nim" - outputsub: "Error: unhandled exception: Problem [EOS]" + file: "tnestedreturn2.nim" + outputsub: "Error: unhandled exception: Problem [OSError]" exitcode: "1" """ proc test4() = try: try: - raise newException(EOS, "Problem") - except EOS: + raise newException(OSError, "Problem") + except OSError: return finally: discard @@ -17,4 +17,4 @@ proc test4() = # but could cause segmentation fault if # exceptions are not handled properly. test4() -raise newException(EOS, "Problem") +raise newException(OSError, "Problem") diff --git a/tests/exception/tunhandledexc.nim b/tests/exception/tunhandledexc.nim index f24881aef..aa9d61236 100644 --- a/tests/exception/tunhandledexc.nim +++ b/tests/exception/tunhandledexc.nim @@ -4,8 +4,8 @@ discard """ exitcode: "1" """ type - ESomething = object of E_Base - ESomeOtherErr = object of E_Base + ESomething = object of Exception + ESomeOtherErr = object of Exception proc genErrors(s: string) = if s == "error!": @@ -13,7 +13,7 @@ proc genErrors(s: string) = else: raise newException(EsomeotherErr, "bla") -when True: +when true: try: genErrors("errssor!") except ESomething: diff --git a/tests/exception/twrongexc.nim b/tests/exception/twrongexc.nim index 755f7d979..4e921b8a3 100644 --- a/tests/exception/twrongexc.nim +++ b/tests/exception/twrongexc.nim @@ -1,11 +1,11 @@ discard """ file: "twrongexc.nim" - outputsub: "Error: unhandled exception: [EInvalidValue]" + outputsub: "Error: unhandled exception: [ValueError]" exitcode: "1" """ try: - raise newException(EInvalidValue, "") -except EOverflow: + raise newException(ValueError, "") +except OverflowError: echo("Error caught") |