aboutsummaryrefslogtreecommitdiff
path: root/tests/coroutines.nom
blob: a67e1c8a00df4c6275590734c4f924625063f31c (plain)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env nomsu -V2.4.4.3
#
    Tests for the stuff defined in core/control_flow.nom

use "core"
%nums = []
%co = (coroutine (: -> 4; -> 5; repeat 3 times: -> 6))
for % in coroutine %co (add % to %nums)
assume (%nums == [4, 5, 6, 6, 6]) or barf "Coroutine iteration failed"
say "Coroutines test passed."