diff options
author | Dominik Picheta <dominikpicheta@gmail.com> | 2016-09-17 13:22:04 +0200 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@gmail.com> | 2016-09-17 13:22:04 +0200 |
commit | 5bf16439e1eddb93b4c9177530ca6640a32de42b (patch) | |
tree | 7904dbf409604e51a0a18cef6b998d57543ef921 /tests | |
parent | 04c1caf02508d0e4100f162f4abed097fac825b0 (diff) | |
download | Nim-5bf16439e1eddb93b4c9177530ca6640a32de42b.tar.gz |
Fixes #4262.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/async/tpolltimeouts.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/async/tpolltimeouts.nim b/tests/async/tpolltimeouts.nim new file mode 100644 index 000000000..dac33732d --- /dev/null +++ b/tests/async/tpolltimeouts.nim @@ -0,0 +1,19 @@ +discard """ + output: "true" +""" +# Issue https://github.com/nim-lang/Nim/issues/4262 +import asyncdispatch, times + +proc foo(): Future[int] {.async.} = + return 1 + +proc bar(): Future[int] {.async.} = + return await foo() + +let start = epochTime() +let barFut = bar() + +while not barFut.finished: + poll(2000) + +echo(epochTime() - start < 1.0) |