add test for raise-only patterns (#391)

* add test for raise-only patterns

https://github.com/status-im/nim-chronos/issues/56

* fix
This commit is contained in:
Jacek Sieka 2023-05-23 18:40:52 +02:00 committed by GitHub
parent 148ddf49c2
commit 4c07da6abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -139,3 +139,20 @@ suite "Closure iterator's exception transformation issues":
answer.inc(10)
waitFor(a())
check answer == 42
test "raise-only":
# https://github.com/status-im/nim-chronos/issues/56
proc trySync() {.async.} =
return
proc x() {.async.} =
try:
await trySync()
return
except ValueError:
discard
raiseAssert "shouldn't reach"
waitFor(x())