make tests green again
This commit is contained in:
parent
9b31f67859
commit
0926754e68
31 changed files with 61 additions and 55 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue