2024-04-12 18:19:32 +08:00
|
|
|
#RUN: %fish -C 'set -l fish %fish' %s
|
2020-02-17 18:12:01 +08:00
|
|
|
|
|
|
|
# Test that fish -n doesn't check for command existence - function autoloading throws a wrench in that.
|
|
|
|
echo "type foo" | $fish -n
|
|
|
|
echo $status
|
|
|
|
#CHECK: 0
|
|
|
|
|
2020-02-17 18:38:21 +08:00
|
|
|
# Test that it doesn't time non-execution.
|
|
|
|
echo "time echo foo" | $fish -n
|
|
|
|
echo $status
|
|
|
|
#CHECK: 0
|
|
|
|
|
2020-02-17 18:12:01 +08:00
|
|
|
# Test that it doesn't check globs.
|
|
|
|
echo "echo /asfjidhfiusnlkxcnvklxcvlkmcxlv*" | $fish -n
|
|
|
|
echo $status
|
|
|
|
#CHECK: 0
|
|
|
|
|
|
|
|
# Test that it does print syntax errors.
|
|
|
|
echo "begin; echo oops" | $fish -n
|
|
|
|
#CHECKERR: fish: Missing end to balance this begin
|
|
|
|
#CHECKERR: begin; echo oops
|
2022-08-11 23:22:03 +08:00
|
|
|
#CHECKERR: ^~~~^
|
2020-02-17 18:12:01 +08:00
|
|
|
echo $status
|
|
|
|
#CHECK: 127
|
|
|
|
|
2023-12-28 17:18:00 +08:00
|
|
|
echo "begin" > broken
|
|
|
|
$fish -n $PWD/broken
|
|
|
|
#CHECKERR: /{{.*}}broken (line 1): Missing end to balance this begin
|
|
|
|
#CHECKERR: begin
|
|
|
|
#CHECKERR: ^~~~^
|
|
|
|
#CHECKERR: warning: Error while reading file /{{.*}}broken
|
|
|
|
|
|
|
|
rm broken
|
|
|
|
|
2020-02-17 18:12:01 +08:00
|
|
|
# Littlecheck assumes a status of 127 means the shebang was invalid.
|
|
|
|
exit 0
|