aboutsummaryrefslogtreecommitdiff
path: root/tests/coroutines.nom
diff options
context:
space:
mode:
Diffstat (limited to 'tests/coroutines.nom')
-rw-r--r--tests/coroutines.nom18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/coroutines.nom b/tests/coroutines.nom
new file mode 100644
index 0000000..8d58170
--- /dev/null
+++ b/tests/coroutines.nom
@@ -0,0 +1,18 @@
+#
+ 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."