Resolve bugs with deep recursion of asyncdispatch.
Introduce callSoon() implementation. Patch tests to use waitFor() instead of asyncCheck()
This commit is contained in:
parent
f4f7edf00f
commit
aba60e54d5
4 changed files with 31 additions and 10 deletions
|
|
@ -48,7 +48,7 @@ proc catch() {.async.} =
|
|||
except OSError, EInvalidField:
|
||||
assert false
|
||||
|
||||
asyncCheck catch()
|
||||
waitFor catch()
|
||||
|
||||
proc test(): Future[bool] {.async.} =
|
||||
result = false
|
||||
|
|
@ -92,13 +92,13 @@ proc test4(): Future[int] {.async.} =
|
|||
result = 2
|
||||
|
||||
var x = test()
|
||||
assert x.read
|
||||
assert x.waitFor()
|
||||
|
||||
x = test2()
|
||||
assert x.read
|
||||
assert x.waitFor()
|
||||
|
||||
var y = test3()
|
||||
assert y.read == 2
|
||||
assert y.waitFor() == 2
|
||||
|
||||
y = test4()
|
||||
assert y.read == 2
|
||||
assert y.waitFor() == 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue