X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Fcommand%2Floop.sh;h=2b1383fe2e676be209077ffed075260275d6de51;hb=b06c888cf2e8c126b04d4678120439533a5086e5;hp=e2b42426bf3c92325e79bb9781f63795128d8493;hpb=f5574c6264163859a8eb94ab1e33bcc1b61fce5f;p=pspp-builds.git diff --git a/tests/command/loop.sh b/tests/command/loop.sh index e2b42426..2b1383fe 100755 --- a/tests/command/loop.sh +++ b/tests/command/loop.sh @@ -57,17 +57,71 @@ cd $TEMPDIR activity="create prog" cat > $TEMPDIR/loop.stat < y. +print/'--------'. +execute. + +echo 'Loop with index and IF condition based on index'. +loop #m=x to y by z if #m < 4. +print /#m. +end loop. +print/'--------'. +execute. + +echo 'Loop with index and END IF condition based on index'. +loop #n=x to y by z. +print /#n. +end loop if #n >= 4. +print/'--------'. +execute. + +echo 'Loop with index and IF and END IF condition based on index'. +loop #o=x to y by z if mod(#o,2) = 0. +print /#o. +end loop if #o >= 4. +print/'--------'. +execute. + +echo 'Loop with no conditions'. +set mxloops = 2. +compute #p = x. +loop. +print /#p. +compute #p = #p + z. +do if #p >= y. +break. +end if. end loop. +print/'--------'. execute. EOF if [ $? -ne 0 ] ; then no_result ; fi @@ -85,18 +139,81 @@ if [ $? -ne 0 ] ; then fail ; fi activity="compare results" perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list diff -b $TEMPDIR/pspp.list - <