mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
test(complete): Add test for external subcommand
This commit is contained in:
parent
d2874a50cf
commit
6a09122421
1 changed files with 18 additions and 0 deletions
|
@ -1077,6 +1077,24 @@ pos_b
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn suggest_external_subcommand() {
|
||||
let mut cmd = Command::new("dynamic")
|
||||
.arg(clap::Arg::new("positional").value_parser(["pos1", "pos2", "pos3"]));
|
||||
|
||||
assert_data_eq!(
|
||||
complete!(cmd, " [TAB]"),
|
||||
snapbox::str![
|
||||
"--help\tPrint help
|
||||
-h\tPrint help
|
||||
pos1
|
||||
pos2
|
||||
pos3
|
||||
"
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sort_and_filter() {
|
||||
let mut cmd = Command::new("exhaustive")
|
||||
|
|
Loading…
Add table
Reference in a new issue