diff options
Diffstat (limited to 'tests/async/tpendingcheck.nim')
-rw-r--r-- | tests/async/tpendingcheck.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/async/tpendingcheck.nim b/tests/async/tpendingcheck.nim new file mode 100644 index 000000000..825acb613 --- /dev/null +++ b/tests/async/tpendingcheck.nim @@ -0,0 +1,21 @@ +discard """ + file: "tpendingcheck.nim" + exitcode: 0 + output: "" +""" + +import asyncdispatch + +doAssert(not hasPendingOperations()) + +proc test() {.async.} = + await sleepAsync(100) + +var f = test() +while not f.finished: + doAssert(hasPendingOperations()) + poll(10) +f.read + +doAssert(not hasPendingOperations()) + |