Fix __fish_describe_command integration test under macOS

__fish_apropos is a huge hack under macOS and it seems that it's either broken
or man pages are missing/not indexed under CI. In all cases, hard-code the
results of __fish_describe_command to test the integration machinery
specifically and get the test to pass under macOS CI.
This commit is contained in:
Mahmoud Al-Qudsi 2024-06-27 21:32:11 -05:00
parent dd7d537d90
commit b5f5fa98bf

View file

@ -605,7 +605,12 @@ complete -C'complete_long_option -ao'
complete -C'complete_long_option lo'
# Check that descriptions are correctly generated for commands.
# We expect to find at least one `wh...` command with a manpage/apropos description, such as
# `whoami`, `whereis`, or `which`. Filter out keywords & default/generic completions to test.
# Override __fish_describe_command to prevent missing man pages or broken __fish_apropos on macOS
# from failing this test. (TODO: Test the latter separately.)
function __fish_describe_command
echo -e "whereis\twhere is it"
echo -e "whoami\twho am i"
echo -e "which\which is it"
end
test (count (complete -C"wh" | string match -rv "\tcommand|^while")) -gt 0 && echo "found" || echo "fail"
# CHECK: found