2021-01-11 14:23:36 +01:00
|
|
|
proc someAsyncProc {.async.} =
|
|
|
|
# perform some async operations using await
|
|
|
|
discard
|
2021-01-11 12:02:40 +01:00
|
|
|
|
2021-01-11 14:23:36 +01:00
|
|
|
suite "test async proc":
|
2021-01-11 12:02:40 +01:00
|
|
|
|
2021-01-11 17:28:55 +01:00
|
|
|
setup:
|
2021-01-11 14:23:36 +01:00
|
|
|
# invoke await in the test setup:
|
|
|
|
await someAsyncProc()
|
2021-01-11 12:02:40 +01:00
|
|
|
|
2021-01-11 17:28:55 +01:00
|
|
|
teardown:
|
2021-01-11 14:23:36 +01:00
|
|
|
# invoke await in the test teardown:
|
|
|
|
await someAsyncProc()
|
2021-01-11 12:02:40 +01:00
|
|
|
|
2021-01-11 17:28:55 +01:00
|
|
|
test "async test":
|
2021-01-11 14:23:36 +01:00
|
|
|
# invoke await in tests:
|
|
|
|
await someAsyncProc()
|
2022-02-24 22:15:45 +11:00
|
|
|
|
|
|
|
suite "test async setupAll and teardownAll, allow multiple suites":
|
|
|
|
|
|
|
|
setupAll:
|
|
|
|
# invoke await in the test setup:
|
|
|
|
await someAsyncProc()
|
|
|
|
|
|
|
|
teardownAll:
|
|
|
|
# invoke await in the test teardown:
|
|
|
|
await someAsyncProc()
|
|
|
|
|
|
|
|
test "async test":
|
|
|
|
# invoke await in tests:
|
|
|
|
await someAsyncProc()
|