From 61fbbc551208aca182ff810661bdf37b08a377cd Mon Sep 17 00:00:00 2001 From: Eugene Kabanov Date: Thu, 16 Jun 2022 14:35:24 +0300 Subject: [PATCH] asyncTest (#286) * Initial commit. * Change name to asynctests. --- chronos/unittest2/asynctests.nim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 chronos/unittest2/asynctests.nim diff --git a/chronos/unittest2/asynctests.nim b/chronos/unittest2/asynctests.nim new file mode 100644 index 00000000..fda03537 --- /dev/null +++ b/chronos/unittest2/asynctests.nim @@ -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 + )())