diff --git a/tests/andandoror.err b/tests/andandoror.err deleted file mode 100644 index 60f61565c..000000000 --- a/tests/andandoror.err +++ /dev/null @@ -1,15 +0,0 @@ - -#################### -# Basic && and || support - -#################### -# && and || in if statements - -#################### -# && and || in while statements - -#################### -# Nots - -#################### -# Complex scenarios diff --git a/tests/andandoror.out b/tests/andandoror.out deleted file mode 100644 index 649267ebd..000000000 --- a/tests/andandoror.out +++ /dev/null @@ -1,40 +0,0 @@ - -#################### -# Basic && and || support -first -second -third -true && false: 1 -true || false: 0 -true && false || true: 0 - -#################### -# && and || in if statements -if test 1 ok -if test 2 ok -if test 3 ok -if test 4 ok - -#################### -# && and || in while statements -0 0 0 -1 1 1 -2 2 2 -3 3 3 -4 4 4 - -#################### -# Nots -0 -1 -1 -0 -not ! -0 - -#################### -# Complex scenarios -1 -2 -3 -4 diff --git a/tests/andandoror.in b/tests/checks/andandoror.fish similarity index 64% rename from tests/andandoror.in rename to tests/checks/andandoror.fish index fff23d3b9..f4adb7a72 100644 --- a/tests/andandoror.in +++ b/tests/checks/andandoror.fish @@ -1,19 +1,30 @@ -logmsg "Basic && and || support" +#RUN: %fish %s +# "Basic && and || support" echo first && echo second echo third || echo fourth true && false ; echo "true && false: $status" true || false ; echo "true || false: $status" true && false || true ; echo "true && false || true: $status" +# CHECK: first +# CHECK: second +# CHECK: third +# CHECK: true && false: 1 +# CHECK: true || false: 0 +# CHECK: true && false || true: 0 -logmsg "&& and || in if statements" +# "&& and || in if statements" if true || false ; echo "if test 1 ok" ; end if true && false ; else; echo "if test 2 ok" ; end if true && false ; or true ; echo "if test 3 ok" ; end if [ 0 = 1 ] || [ 5 -ge 3 ] ; echo "if test 4 ok"; end +# CHECK: if test 1 ok +# CHECK: if test 2 ok +# CHECK: if test 3 ok +# CHECK: if test 4 ok -logmsg "&& and || in while statements" +# "&& and || in while statements" set alpha 0 set beta 0 @@ -27,16 +38,27 @@ while [ $alpha -lt 2 ] && [ $beta -lt 3 ] set gamma ( math $gamma + 1 ) set delta ( math $delta + 1 ) end +# CHECK: 0 0 0 +# CHECK: 1 1 1 +# CHECK: 2 2 2 +# CHECK: 3 3 3 +# CHECK: 4 4 4 -logmsg "Nots" +# "Nots" true && ! false ; echo $status not true && ! false ; echo $status not not not true ; echo $status not ! ! not true ; echo $status not ! echo not ! ; echo $status +# CHECK: 0 +# CHECK: 1 +# CHECK: 1 +# CHECK: 0 +# CHECK: not ! +# CHECK: 0 -logmsg "Complex scenarios" +# "Complex scenarios" begin; echo 1 ; false ; end || begin ; echo 2 && echo 3 ; end @@ -44,3 +66,7 @@ if false && true or not false echo 4 end +# CHECK: 1 +# CHECK: 2 +# CHECK: 3 +# CHECK: 4