diff options
Diffstat (limited to 'tests/async/tasynctry.nim')
-rw-r--r-- | tests/async/tasynctry.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/async/tasynctry.nim b/tests/async/tasynctry.nim index 99433b9d8..f77198e2e 100644 --- a/tests/async/tasynctry.nim +++ b/tests/async/tasynctry.nim @@ -82,6 +82,15 @@ proc test3(): Future[int] {.async.} = result = 2 return +proc test4(): Future[int] {.async.} = + try: + discard await foo() + raise newException(ValueError, "Test4") + except OSError: + result = 1 + except: + result = 2 + var x = test() assert x.read @@ -90,3 +99,6 @@ assert x.read var y = test3() assert y.read == 2 + +y = test4() +assert y.read == 2 |