tpendingcheck.nim 266 B

12345678910111213141516171819
  1. discard """
  2. output: ""
  3. """
  4. import asyncdispatch
  5. doAssert(not hasPendingOperations())
  6. proc test() {.async.} =
  7. await sleepAsync(50)
  8. var f = test()
  9. while not f.finished:
  10. doAssert(hasPendingOperations())
  11. poll(10)
  12. f.read
  13. doAssert(not hasPendingOperations())