-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: enhanced checkExpiring macro with custom timeout (#1023)
- Loading branch information
1 parent
c1dfd58
commit e0f70b7
Showing
13 changed files
with
171 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{.used.} | ||
|
||
# Nim-Libp2p | ||
# Copyright (c) 2023 Status Research & Development GmbH | ||
# Licensed under either of | ||
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) | ||
# * MIT license ([LICENSE-MIT](LICENSE-MIT)) | ||
# at your option. | ||
# This file may not be copied, modified, or distributed except according to | ||
# those terms. | ||
|
||
import ./helpers | ||
|
||
suite "Helpers": | ||
|
||
asyncTest "checkUntilTimeout should pass if the condition is true": | ||
let a = 2 | ||
let b = 2 | ||
checkUntilTimeout: | ||
a == b | ||
|
||
asyncTest "checkUntilTimeout should pass if the conditions are true": | ||
let a = 2 | ||
let b = 2 | ||
checkUntilTimeout: | ||
a == b | ||
a == 2 | ||
b == 2 | ||
|
||
asyncTest "checkUntilCustomTimeout should pass when the condition is true": | ||
let a = 2 | ||
let b = 2 | ||
checkUntilCustomTimeout(2.seconds): | ||
a == b | ||
|
||
asyncTest "checkUntilCustomTimeout should pass when the conditions are true": | ||
let a = 2 | ||
let b = 2 | ||
checkUntilCustomTimeout(5.seconds): | ||
a == b | ||
a == 2 | ||
b == 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.