summary refs log tree commit diff stats
path: root/tests/async/t7758.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/async/t7758.nim')
-rw-r--r--tests/async/t7758.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/async/t7758.nim b/tests/async/t7758.nim
new file mode 100644
index 000000000..102a4ce4c
--- /dev/null
+++ b/tests/async/t7758.nim
@@ -0,0 +1,19 @@
+discard """
+  file: "t7758.nim"
+  exitcode: 0
+"""
+import asyncdispatch
+
+proc task() {.async.} =
+  await sleepAsync(40)
+
+proc main() =
+  var counter = 0
+  var f = task()
+  while not f.finished:
+    inc(counter)
+    poll(10)
+
+  doAssert counter <= 4
+
+for i in 0 .. 10: main()
\ No newline at end of file