summary refs log tree commit diff stats
path: root/tests/async
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2018-08-23 17:38:33 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-08-23 20:35:22 +0200
commit07e1da834202dbfd09abfa73f191b7779da16f84 (patch)
tree30e6657085b50780edab542c9240cf8927f6a699 /tests/async
parent8aae5c9385c5273c4339a242222a14afead19f2f (diff)
downloadNim-07e1da834202dbfd09abfa73f191b7779da16f84.tar.gz
Adds test case for #6846. (#8729)
Diffstat (limited to 'tests/async')
-rw-r--r--tests/async/t6846.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/async/t6846.nim b/tests/async/t6846.nim
new file mode 100644
index 000000000..687a3f865
--- /dev/null
+++ b/tests/async/t6846.nim
@@ -0,0 +1,16 @@
+discard """
+  exitcode: 0
+  output: "hello world"
+  disabled: windows
+"""
+
+import asyncdispatch
+import asyncfile
+import times
+
+var asyncStdout = 1.AsyncFD.newAsyncFile()
+proc doStuff: Future[void] {.async.} =
+  await asyncStdout.write "hello world\n"
+
+let fut = doStuff()
+doAssert fut.finished, "Poll is needed unnecessarily. See #6846."
\ No newline at end of file