make tests green again

This commit is contained in:
Andreas Rumpf 2018-07-05 15:51:04 +02:00
commit 0926754e68
31 changed files with 61 additions and 55 deletions

View file

@ -15,7 +15,7 @@ import asyncdispatch, strutils
proc foobar() {.async.} =
if 5 == 5:
raise newException(EInvalidIndex, "Test")
raise newException(IndexError, "Test")
proc catch() {.async.} =
# TODO: Create a test for when exceptions are not caught.
@ -26,26 +26,26 @@ proc catch() {.async.} =
try:
await foobar()
except EInvalidIndex:
except IndexError:
echo("Specific except")
try:
await foobar()
except OSError, EInvalidField, EInvalidIndex:
except OSError, FieldError, IndexError:
echo("Multiple idents in except")
try:
await foobar()
except OSError, EInvalidField:
except OSError, FieldError:
assert false
except EInvalidIndex:
except IndexError:
echo("Multiple except branches")
try:
await foobar()
except EInvalidIndex:
except IndexError:
echo("Multiple except branches 2")
except OSError, EInvalidField:
except OSError, FieldError:
assert false
waitFor catch()