asyncTest (#286)

* Initial commit.

* Change name to asynctests.
This commit is contained in:
Eugene Kabanov 2022-06-16 14:35:24 +03:00 committed by GitHub
parent f403b06de6
commit 61fbbc5512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#
# Chronos Unittest2 Helpers
# (c) Copyright 2022-Present
# Status Research & Development GmbH
#
# Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT)
import unittest2
import ../../chronos
export unittest2, chronos
template asyncTest*(name: string, body: untyped): untyped =
test name:
waitFor((
proc() {.async, gcsafe.} =
body
)())