aboutsummaryrefslogtreecommitdiff
path: root/tests/control_flow.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/control_flow.nom
parentc161f48838ea13a98c37d50df030ad336be97171 (diff)
Updating tests.
Diffstat (limited to 'tests/control_flow.nom')
-rw-r--r--tests/control_flow.nom23
1 files changed, 2 insertions, 21 deletions
diff --git a/tests/control_flow.nom b/tests/control_flow.nom
index 238bcbf..56c99a0 100644
--- a/tests/control_flow.nom
+++ b/tests/control_flow.nom
@@ -159,32 +159,11 @@ when 5 = ?
* else: %when_worked <- (yes)
assume %when_worked
-try: barf
-..and if it succeeds: barf "try failed."
-
-%worked <- (no)
-try: barf
-..and if it barfs: %worked <- (yes)
-assume %worked or barf "try/catch failed"
-
%x <- 1
do
%x <- 2
assume (%x = 2) or barf "'do' is redefining locals"
-%x <- 1
-try
- %x <- 2
- do
- barf
- ..then always
- %x <- 3
-..and if it barfs: do nothing
-lua> "collectgarbage()"
-assume (%x = 3) or barf "do/then always failed"
-
-say "Control flow test passed."
-
assume
(..)
result of
@@ -192,4 +171,6 @@ assume
for % in [1,2,3]: %n +<- %
return %n
..= 6
+..or barf "'result of %' failed"
+say "Control flow test passed."