diff options
Diffstat (limited to 'tests/coroutines.nom')
| -rw-r--r-- | tests/coroutines.nom | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/coroutines.nom b/tests/coroutines.nom index 16ef100..54b233e 100644 --- a/tests/coroutines.nom +++ b/tests/coroutines.nom @@ -1,19 +1,10 @@ -#!/usr/bin/env nomsu -V1 +#!/usr/bin/env nomsu -V2.3.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." +%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."
\ No newline at end of file |
