diff options
author | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2018-04-30 21:39:41 +0300 |
---|---|---|
committer | Yuriy Glukhov <yuriy.glukhov@gmail.com> | 2018-05-09 22:25:27 +0300 |
commit | 7d38db284ba2655bf19cb9c0785240616074ee44 (patch) | |
tree | 647c6f349abeb60c21f53f1d64a31dfae56eb90f | |
parent | d71f69ab50f079c03860f244f6c64b555ca403b6 (diff) | |
download | Nim-7d38db284ba2655bf19cb9c0785240616074ee44.tar.gz |
Extended tasync_in_seq_constr test
-rw-r--r-- | tests/async/tasync_in_seq_constr.nim | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/async/tasync_in_seq_constr.nim b/tests/async/tasync_in_seq_constr.nim index cf9bb5451..3d6dae245 100644 --- a/tests/async/tasync_in_seq_constr.nim +++ b/tests/async/tasync_in_seq_constr.nim @@ -1,17 +1,25 @@ discard """ - output: "@[1, 2, 3, 4]" + output: ''' +@[1, 2, 3, 4] +123 +''' """ # bug #5314, bug #6626 import asyncdispatch -proc bar(): Future[int] {.async.} = - await sleepAsync(500) - result = 3 +proc bar(i: int): Future[int] {.async.} = + await sleepAsync(2) + result = i proc foo(): Future[seq[int]] {.async.} = - await sleepAsync(500) - result = @[1, 2, await bar(), 4] # <--- The bug is here + await sleepAsync(2) + result = @[1, 2, await bar(3), 4] # <--- The bug is here + +proc foo2() {.async.} = + await sleepAsync(2) + echo(await bar(1), await bar(2), await bar(3)) echo waitFor foo() +waitFor foo2() |