Skip to content

Commit

Permalink
Fix: ensure that eventually works when std/times is imported
Browse files Browse the repository at this point in the history
  • Loading branch information
markspanbroek committed Jan 10, 2024
1 parent 98f99df commit 3313b54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions asynctest/private/chronos/eventually.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pkg/chronos

template eventually*(expression: untyped, timeout=5000): bool =
bind Moment, now, milliseconds

proc eventually: Future[bool] {.async.} =
let endTime = Moment.now() + timeout.milliseconds
Expand Down
7 changes: 7 additions & 0 deletions testmodules/chronosv4/test.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ import pkg/asynctest/chronos/unittest

include ../common/testbody
include ../common/testfail

import std/times

suite "eventually and std/times":

test "compiles when both chronos and std/times are imported":
check eventually true

0 comments on commit 3313b54

Please sign in to comment.