From a42711e31cdb41e3c504ed161c07e56698d29e7a Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 28 Dec 2013 22:52:06 -0800 Subject: Support for break/continue with new parser execution --- tests/test9.in | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/test9.in') diff --git a/tests/test9.in b/tests/test9.in index a38fbc7c..a16281f1 100644 --- a/tests/test9.in +++ b/tests/test9.in @@ -35,3 +35,37 @@ emit test3 foo bar # test empty argument emit + +echo "Test break and continue" +# This should output Ping once +for i in a b c + if not contains $i c ; continue ; end + echo Ping +end + +# This should output Pong not at all +for i in a b c + if not contains $i c ; break ; end + echo Pong +end + +# This should output Foop three times, and Boop not at all +set i a a a +while contains $i a + set -e i[-1] + echo Foop + continue + echo Boop +end + +# This should output Doop once +set i a a a +while contains $i a + set -e i[-1] + echo Doop + break + echo Darp +end + + +false -- cgit v1.2.3