t6846.nim 337 B

12345678910111213141516
  1. discard """
  2. exitcode: 0
  3. output: "hello world"
  4. disabled: windows
  5. """
  6. import asyncdispatch
  7. import asyncfile
  8. import times
  9. var asyncStdout = 1.AsyncFD.newAsyncFile()
  10. proc doStuff: Future[void] {.async.} =
  11. await asyncStdout.write "hello world\n"
  12. let fut = doStuff()
  13. doAssert fut.finished, "Poll is needed unnecessarily. See #6846."