mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-10 06:46:24 +00:00
df338b19d1
* Move waku filter utility functions to a different file for reuse. * Add asyncSetup and asyncTeardown templates. * Implement waku filter subscriber ping tests.
17 lines
388 B
Nim
17 lines
388 B
Nim
# Sourced from: vendor/nim-libp2p/tests/testutils.nim
|
|
# Adds the ability for asyncSetup and asyncTeardown to be used in unittest2
|
|
|
|
template asyncTeardown*(body: untyped): untyped =
|
|
teardown:
|
|
waitFor((
|
|
proc() {.async, gcsafe.} =
|
|
body
|
|
)())
|
|
|
|
template asyncSetup*(body: untyped): untyped =
|
|
setup:
|
|
waitFor((
|
|
proc() {.async, gcsafe.} =
|
|
body
|
|
)())
|