diff options
Diffstat (limited to 'tests/async/t7758.nim')
-rw-r--r-- | tests/async/t7758.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/async/t7758.nim b/tests/async/t7758.nim new file mode 100644 index 000000000..57d0f4004 --- /dev/null +++ b/tests/async/t7758.nim @@ -0,0 +1,17 @@ +discard """ + file: "t7758.nim" + exitcode: 0 +""" +import asyncdispatch + +proc task() {.async.} = + await sleepAsync(1000) + +when isMainModule: + var counter = 0 + var f = task() + while not f.finished: + inc(counter) + poll() + +doAssert counter == 2 \ No newline at end of file |