aboutsummaryrefslogtreecommitdiff
path: root/tests/coroutines.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-06-15 00:40:36 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-06-15 00:40:40 -0700
commit5629b81f78c722e8001b8cee1628085a78a8ea9f (patch)
treefc3b36c3c4ac5176d8269e523109468f2ff6be77 /tests/coroutines.nom
parentc161f48838ea13a98c37d50df030ad336be97171 (diff)
Updating tests.
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."