2019-11-25 11:47:33 +00:00
|
|
|
#RUN: %fish %s
|
|
|
|
|
|
|
|
set -xl LANG C # uniform quotes
|
|
|
|
|
|
|
|
eval 'true | and'
|
|
|
|
# CHECKERR: {{.*}}: The 'and' command can not be used in a pipeline
|
2022-08-12 15:04:30 +00:00
|
|
|
# CHECKERR: true | and
|
|
|
|
# CHECKERR: ^~^
|
2019-11-25 11:47:33 +00:00
|
|
|
|
|
|
|
eval 'true | or'
|
|
|
|
# CHECKERR: {{.*}}: The 'or' command can not be used in a pipeline
|
2022-08-12 15:04:30 +00:00
|
|
|
# CHECKERR: true | or
|
|
|
|
# CHECKERR: ^^
|
2020-02-08 14:37:10 +00:00
|
|
|
|
|
|
|
# Verify and/or behavior with if and while
|
2020-03-09 18:36:12 +00:00
|
|
|
if false; or true
|
|
|
|
echo success1
|
|
|
|
end
|
2020-02-08 14:37:10 +00:00
|
|
|
# CHECK: success1
|
2020-03-09 18:36:12 +00:00
|
|
|
if false; and false
|
|
|
|
echo failure1
|
|
|
|
end
|
|
|
|
while false; and false; or true
|
|
|
|
echo success2
|
|
|
|
break
|
|
|
|
end
|
2020-02-08 14:37:10 +00:00
|
|
|
# CHECK: success2
|
2020-03-09 18:36:12 +00:00
|
|
|
while false; or begin
|
|
|
|
false; or true
|
|
|
|
end
|
|
|
|
echo success3
|
|
|
|
break
|
|
|
|
end
|
2020-02-08 14:37:10 +00:00
|
|
|
# CHECK: success3
|
2020-03-09 18:36:12 +00:00
|
|
|
if false
|
|
|
|
else if false; and true
|
|
|
|
else if false; and false
|
|
|
|
else if false; or true
|
|
|
|
echo success4
|
|
|
|
end
|
2020-02-08 14:37:10 +00:00
|
|
|
# CHECK: success4
|
2020-03-09 18:36:12 +00:00
|
|
|
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
|