mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
test(clap_complete): Add test cases for -fbar
and -f=bar
completion
This commit is contained in:
parent
5efa52ad45
commit
48a23f5c94
1 changed files with 50 additions and 0 deletions
|
@ -402,6 +402,56 @@ pos_b
|
|||
pos_c"
|
||||
]
|
||||
);
|
||||
|
||||
assert_data_eq!(
|
||||
complete!(cmd, "-ci[TAB]", current_dir = Some(testdir_path)),
|
||||
snapbox::str![
|
||||
"-cii
|
||||
-ciF
|
||||
-cic
|
||||
-cih Print help"
|
||||
]
|
||||
);
|
||||
|
||||
assert_data_eq!(
|
||||
complete!(cmd, "-ci=[TAB]", current_dir = Some(testdir_path)),
|
||||
snapbox::str![
|
||||
"-ci=i
|
||||
-ci=F
|
||||
-ci=c
|
||||
-ci=h Print help"
|
||||
]
|
||||
);
|
||||
|
||||
assert_data_eq!(
|
||||
complete!(cmd, "-ci=a[TAB]", current_dir = Some(testdir_path)),
|
||||
snapbox::str![
|
||||
"-ci=ai
|
||||
-ci=aF
|
||||
-ci=ac
|
||||
-ci=ah Print help"
|
||||
]
|
||||
);
|
||||
|
||||
assert_data_eq!(
|
||||
complete!(cmd, "-ciF[TAB]", current_dir = Some(testdir_path)),
|
||||
snapbox::str![
|
||||
"-ciFi
|
||||
-ciFF
|
||||
-ciFc
|
||||
-ciFh\tPrint help"
|
||||
]
|
||||
);
|
||||
|
||||
assert_data_eq!(
|
||||
complete!(cmd, "-ciF=[TAB]", current_dir = Some(testdir_path)),
|
||||
snapbox::str![
|
||||
"-ciF=i
|
||||
-ciF=F
|
||||
-ciF=c
|
||||
-ciF=h\tPrint help"
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
fn complete(cmd: &mut Command, args: impl AsRef<str>, current_dir: Option<&Path>) -> String {
|
||||
|
|
Loading…
Reference in a new issue