mirror of
https://github.com/logos-storage/asynctest.git
synced 2026-01-05 22:43:06 +00:00
Fix: ensure that eventually works when std/times is imported
This commit is contained in:
parent
98f99df4b4
commit
3313b54fc0
@ -1,6 +1,7 @@
|
|||||||
import pkg/chronos
|
import pkg/chronos
|
||||||
|
|
||||||
template eventually*(expression: untyped, timeout=5000): bool =
|
template eventually*(expression: untyped, timeout=5000): bool =
|
||||||
|
bind Moment, now, milliseconds
|
||||||
|
|
||||||
proc eventually: Future[bool] {.async.} =
|
proc eventually: Future[bool] {.async.} =
|
||||||
let endTime = Moment.now() + timeout.milliseconds
|
let endTime = Moment.now() + timeout.milliseconds
|
||||||
|
|||||||
@ -2,3 +2,10 @@ import pkg/asynctest/chronos/unittest
|
|||||||
|
|
||||||
include ../common/testbody
|
include ../common/testbody
|
||||||
include ../common/testfail
|
include ../common/testfail
|
||||||
|
|
||||||
|
import std/times
|
||||||
|
|
||||||
|
suite "eventually and std/times":
|
||||||
|
|
||||||
|
test "compiles when both chronos and std/times are imported":
|
||||||
|
check eventually true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user