From 7d38db284ba2655bf19cb9c0785240616074ee44 Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Mon, 30 Apr 2018 21:39:41 +0300 Subject: Extended tasync_in_seq_constr test --- tests/async/tasync_in_seq_constr.nim | 20 ++++++++++++++------ 1 file 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() -- cgit 1.4.1-2-gfad0