aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-12-11 11:44:54 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-12-19 11:32:57 -0800
commit0a6f62358b990e1f1c393ce1eb9ce4f978680866 (patch)
tree479a079ce3cfdc5e559a68f0fe0f53840e6bbf71 /tests
parent8c707a4e2ffc30bae6d9ac3a28bd05fca0ff1195 (diff)
Write tests for new if/and/or behavior (#1428)
They fail for now.
Diffstat (limited to 'tests')
-rw-r--r--tests/test8.in12
-rw-r--r--tests/test8.out4
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/test8.in b/tests/test8.in
index a31ad127..22cb3b12 100644
--- a/tests/test8.in
+++ b/tests/test8.in
@@ -27,3 +27,15 @@ echo $test[1..(count $test)]
# See issue 1061
echo "Verify that if statements swallow failure"
if false ; end ; echo $status
+
+# Verify and/or behavior with if and while statements
+if false ; or true ; echo "success1" ; end
+if false ; and false ; echo "failure1" ; end
+while false ; and false ; or true ; echo "success2"; break ; end
+while false; or begin ; false; or true; end; echo "success3"; end
+if false ; else if false ; and true ; else if false ; and false ; else if false; or true; echo "success 4"; end
+if false ; else if false ; and true ; else if false ; or false ; else if false; echo "failure 4"; end
+if false ; or true | false ; echo "failure5" ; end
+
+# Catch this corner case, which should produce an error
+if false ; or --help ; end
diff --git a/tests/test8.out b/tests/test8.out
index 4ac13406..1e9099f8 100644
--- a/tests/test8.out
+++ b/tests/test8.out
@@ -17,3 +17,7 @@ Test more
1 2 3 4 5 6 7 8 9 10
Verify that if statements swallow failure
0
+success1
+success2
+success3
+success4