nomsu/tests/coroutines.nom

20 lines
336 B
Plaintext
Raw Normal View History

#!/usr/bin/env nomsu -V1
2018-06-15 00:40:36 -07:00
#
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."