From 964f1ff7a77e0cc1c73f12d02969421c36d32e1c Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Thu, 23 Aug 2018 17:38:33 +0100 Subject: [PATCH] Adds test case for #6846. (#8729) --- tests/async/t6846.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/async/t6846.nim diff --git a/tests/async/t6846.nim b/tests/async/t6846.nim new file mode 100644 index 0000000000000..687a3f8654387 --- /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