2024-04-12 10:19:32 +00:00
|
|
|
#RUN: env FISH_PATH=%fish FILE_PATH=%s %fish %s
|
2020-01-25 22:10:45 +00:00
|
|
|
|
|
|
|
status line-number
|
|
|
|
# CHECK: 3
|
|
|
|
|
|
|
|
# Check status fish-path
|
|
|
|
# No output expected on success
|
2021-06-24 18:07:54 +00:00
|
|
|
#
|
|
|
|
# argv[0] on OpenBSD is just the filename, not the path
|
|
|
|
# That means fish-path is unsupportable there.
|
|
|
|
if not contains (uname) OpenBSD
|
|
|
|
set status_fish_path (realpath (status fish-path))
|
|
|
|
set env_fish_path (realpath $FISH_PATH)
|
|
|
|
test "$status_fish_path" = "$env_fish_path"
|
|
|
|
or echo "Fish path disagreement: $status_fish_path vs $env_fish_path"
|
|
|
|
end
|
2020-01-25 22:10:45 +00:00
|
|
|
|
|
|
|
# Check is-block
|
2020-03-09 18:36:12 +00:00
|
|
|
status is-block
|
|
|
|
echo $status
|
|
|
|
begin
|
|
|
|
status is-block
|
|
|
|
echo $status
|
|
|
|
end
|
2020-01-25 22:10:45 +00:00
|
|
|
# CHECK: 1
|
|
|
|
# CHECK: 0
|
|
|
|
|
|
|
|
# Check filename
|
|
|
|
set status_filename (status filename)
|
|
|
|
test (status filename) = "$FILE_PATH"
|
|
|
|
or echo "File path disagreement: $status_filename vs $FILE_PATH"
|
|
|
|
|
|
|
|
function print_my_name
|
|
|
|
status function
|
|
|
|
end
|
|
|
|
print_my_name
|
|
|
|
# CHECK: print_my_name
|
|
|
|
|
2020-03-09 18:36:12 +00:00
|
|
|
status is-command-substitution
|
|
|
|
echo $status
|
2020-01-25 22:10:45 +00:00
|
|
|
echo (status is-command-substitution; echo $status)
|
|
|
|
# CHECK: 1
|
|
|
|
# CHECK: 0
|
2020-06-01 14:46:20 +00:00
|
|
|
|
|
|
|
test (status filename) = (status dirname)/(status basename)
|
|
|
|
|
|
|
|
status basename
|
|
|
|
#CHECK: status-command.fish
|
|
|
|
|
|
|
|
status dirname | string match -q '*checks'
|
|
|
|
echo $status
|
|
|
|
#CHECK: 0
|
|
|
|
|
|
|
|
echo "status dirname" | source
|
|
|
|
#CHECK: .
|
|
|
|
|
|
|
|
$FISH_PATH -c 'status dirname'
|
|
|
|
#CHECK: Standard input
|