2024-04-12 18:19:32 +08:00
|
|
|
# RUN: %fish -C 'set -g fish %fish' %s
|
2020-01-24 09:34:46 +08:00
|
|
|
|
|
|
|
# Empty commands should be 123
|
|
|
|
set empty_var
|
|
|
|
$empty_var
|
|
|
|
echo $status
|
|
|
|
# CHECK: 123
|
|
|
|
# CHECKERR: {{.*}} The expanded command was empty.
|
|
|
|
# CHECKERR: $empty_var
|
2022-08-12 00:20:40 +08:00
|
|
|
# CHECKERR: ^~~~~~~~~^
|
2020-01-24 09:34:46 +08:00
|
|
|
|
|
|
|
# Failed expansions
|
|
|
|
echo "$abc["
|
|
|
|
echo $status
|
|
|
|
# CHECK: 121
|
|
|
|
# CHECKERR: {{.*}} Invalid index value
|
|
|
|
# CHECKERR: echo "$abc["
|
2022-08-12 01:24:41 +08:00
|
|
|
# CHECKERR: ^
|
2020-01-24 09:34:46 +08:00
|
|
|
|
|
|
|
# Failed wildcards
|
|
|
|
echo *gibberishgibberishgibberish*
|
|
|
|
echo $status
|
|
|
|
# CHECK: 124
|
|
|
|
# CHECKERR: {{.*}} No matches for wildcard '*gibberishgibberishgibberish*'. {{.*}}
|
|
|
|
# CHECKERR: echo *gibberishgibberishgibberish*
|
2022-08-11 23:22:03 +08:00
|
|
|
# CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
2023-03-14 17:50:22 +08:00
|
|
|
|
|
|
|
$fish -c 'exit -5'
|
2024-01-05 23:52:18 +08:00
|
|
|
# CHECKERR: warning: builtin exit returned invalid exit code -5
|
2023-03-14 17:50:22 +08:00
|
|
|
echo $status
|
|
|
|
# CHECK: 251
|
|
|
|
|
|
|
|
$fish -c 'exit -1'
|
2024-01-05 23:52:18 +08:00
|
|
|
# CHECKERR: warning: builtin exit returned invalid exit code -1
|
2023-03-14 17:50:22 +08:00
|
|
|
echo $status
|
|
|
|
# CHECK: 255
|
|
|
|
|
|
|
|
# (we avoid 0, so this is turned into 255 again)
|
|
|
|
$fish -c 'exit -256'
|
2024-01-05 23:52:18 +08:00
|
|
|
# CHECKERR: warning: builtin exit returned invalid exit code -256
|
2023-03-14 17:50:22 +08:00
|
|
|
echo $status
|
|
|
|
# CHECK: 255
|
|
|
|
|
|
|
|
$fish -c 'exit -512'
|
2024-01-05 23:52:18 +08:00
|
|
|
# CHECKERR: warning: builtin exit returned invalid exit code -512
|
2023-03-14 17:50:22 +08:00
|
|
|
echo $status
|
|
|
|
# CHECK: 255
|