From dd7d537d9029853096e3c5cb6a23ad96c028532f Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 27 Jun 2024 20:45:38 -0500 Subject: [PATCH] Add regression test for command completion descriptions --- tests/checks/complete.fish | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/checks/complete.fish b/tests/checks/complete.fish index b882a95b9543..aa775441d142 100644 --- a/tests/checks/complete.fish +++ b/tests/checks/complete.fish @@ -603,3 +603,9 @@ complete -C'complete_long_option -ao' # CHECK: -an-old-option # But only if the user typed a dash 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. +test (count (complete -C"wh" | string match -rv "\tcommand|^while")) -gt 0 && echo "found" || echo "fail" +# CHECK: found