Resolve bugs with deep recursion of asyncdispatch.

Introduce callSoon() implementation.
Patch tests to use waitFor() instead of asyncCheck()
This commit is contained in:
cheatfate 2016-05-18 00:53:53 +03:00
commit aba60e54d5
4 changed files with 31 additions and 10 deletions

View file

@ -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