diff options
author | cheatfate <ka@hardcore.kiev.ua> | 2016-05-18 00:53:53 +0300 |
---|---|---|
committer | cheatfate <ka@hardcore.kiev.ua> | 2016-05-18 00:53:53 +0300 |
commit | aba60e54d58a0425ae707efef4e3dfcf1a54064d (patch) | |
tree | 999699e9fb1120e0480bc0dcda1abc5cc75d7c87 /tests | |
parent | f4f7edf00f19e5abcd4f3a4631261e109d6b8c4d (diff) | |
download | Nim-aba60e54d58a0425ae707efef4e3dfcf1a54064d.tar.gz |
Resolve bugs with `deep recursion` of asyncdispatch.
Introduce callSoon() implementation. Patch tests to use waitFor() instead of asyncCheck()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/async/tasyncdiscard.nim | 2 | ||||
-rw-r--r-- | tests/async/tasynctry.nim | 10 | ||||
-rw-r--r-- | tests/ccgbugs/twrong_string_asgn.nim | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/async/tasyncdiscard.nim b/tests/async/tasyncdiscard.nim index 71aba29e2..e7c87ad42 100644 --- a/tests/async/tasyncdiscard.nim +++ b/tests/async/tasyncdiscard.nim @@ -36,4 +36,4 @@ proc main {.async.} = discard await g() echo 6 -asyncCheck main() +waitFor(main()) diff --git a/tests/async/tasynctry.nim b/tests/async/tasynctry.nim index f77198e2e..5930f296f 100644 --- a/tests/async/tasynctry.nim +++ b/tests/async/tasynctry.nim @@ -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 diff --git a/tests/ccgbugs/twrong_string_asgn.nim b/tests/ccgbugs/twrong_string_asgn.nim index b62e70e7c..669b7f8f5 100644 --- a/tests/ccgbugs/twrong_string_asgn.nim +++ b/tests/ccgbugs/twrong_string_asgn.nim @@ -16,4 +16,4 @@ x.callback = proc () = finished = true -while not finished: discard +while not finished: poll() |