summary refs log tree commit diff stats
path: root/tests/async
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2018-08-23 15:31:28 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-08-23 20:35:22 +0200
commit1b1633991a738f100101407ffd1b16a08362814b (patch)
treeac3efa51fcf9320bb8f6dbbc6a968e98dc906493 /tests/async
parent1c3cfd74fff010b6759a27ce44f01bf08159d418 (diff)
downloadNim-1b1633991a738f100101407ffd1b16a08362814b.tar.gz
Don't skip poll() when no handles are present. (#8727)
Fixes #7886.

Fixes #7758.

Fixes #6929.

Fixes #3909.

Replaces #8209.
Diffstat (limited to 'tests/async')
-rw-r--r--tests/async/t7758.nim17
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