diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2016-12-30 11:06:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-30 11:06:38 +0000 |
commit | 09b6d8c0ca5f9b5590e58d90b987975f36df8dd6 (patch) | |
tree | 7d03896d1250a72d02ba3e4a39c4840ff1749768 /tests | |
parent | cfea779e23bbcd586044cfe7be412dc87aad7c50 (diff) | |
parent | 8e71949b785ca2b2bc61d0f95c5ac88fa87621fe (diff) | |
download | Nim-09b6d8c0ca5f9b5590e58d90b987975f36df8dd6.tar.gz |
Merge pull request #5163 from vegansk/5155-async
Adds pending operations presence check function to asyncdispatch, fixes #5155
Diffstat (limited to 'tests')
-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()) + |