summary refs log tree commit diff stats
path: root/tests/async/tpendingcheck.nim
blob: 825acb6135c000f5274d1d83e76e9c281a91f06b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
discard """
  file: "tpendingcheck.nim"
  exitcode: 0
  output: ""
"""

import asyncdispatch

doAssert(not hasPendingOperations())

proc test() {.async.} =
  await sleepAsync(100)

var f = test()
while not f.finished:
  doAssert(hasPendingOperations())
  poll(10)
f.read

doAssert(not hasPendingOperations())