test(comlete): Show all fish completions

This commit is contained in:
Lzu Tao 2024-06-27 22:36:32 +07:00 committed by Ed Page
parent 3689a4c867
commit 7c00ad2e3e

View file

@ -182,9 +182,9 @@ fn complete_dynamic() {
let mut runtime =
common::load_runtime::<completest_pty::FishRuntimeBuilder>("dynamic", "exhaustive");
let input = "exhaustive \t";
let input = "exhaustive \t\t";
let expected = snapbox::str![[r#"
% exhaustive
% exhaustive action
action last -V (Print version)
alias pacman --generate (generate)
complete (Register shell completions for this program) quote --global (everywhere)
@ -194,14 +194,29 @@ hint -h (Print he
let actual = runtime.complete(input, &term).unwrap();
assert_data_eq!(actual, expected);
let input = "exhaustive quote \t";
let input = "exhaustive quote \t\t";
let expected = snapbox::str![[r#"
% exhaustive quote
cmd-backslash (Avoid '/n')
cmd-backticks (For more information see `echo test`)
cmd-brackets (List packages [filter])
cmd-double-quotes (Can be "always", "auto", or "never")
and 16 more rows
cmd-expansions (Execute the shell command with $SHELL)
cmd-single-quotes (Can be 'always', 'auto', or 'never')
escape-help (/tab "')
help (Print this message or the help of the given subcommand(s))
-h (Print help (see more with '--help'))
-V (Print version)
--backslash (Avoid '/n')
--backticks (For more information see `echo test`)
--brackets (List packages [filter])
--choice
--double-quotes (Can be "always", "auto", or "never")
--expansions (Execute the shell command with $SHELL)
--global (everywhere)
--help (Print help (see more with '--help'))
--single-quotes (Can be 'always', 'auto', or 'never')
--version (Print version)
"#]];
let actual = runtime.complete(input, &term).unwrap();
assert_data_eq!(actual, expected);