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