Files
Nim/tests/coroutines/twait.nim
Dylan Modesitt e35b21e553 Close#5586 (#14682)
* re-enable macos and bsd on some coro tests

* re-enable macos and bsd on some coro tests
2020-06-16 16:24:26 +02:00

21 lines
294 B
Nim

discard """
output: "Exit 1\nExit 2"
target: "c"
"""
import coro
var coro1: CoroutineRef
proc testCoroutine1() =
for i in 0..<10:
suspend(0)
echo "Exit 1"
proc testCoroutine2() =
coro1.wait()
echo "Exit 2"
coro1 = coro.start(testCoroutine1)
coro.start(testCoroutine2)
run()