Skip to content

Commit

Permalink
test(complete): Ensure ArgValueCandidates get filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 21, 2024
1 parent 9bef077 commit 431e2bc
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions clap_complete/tests/testsuite/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ d_dir/
fn suggest_custom_arg_value() {
fn custom_completer() -> Vec<CompletionCandidate> {
vec![
CompletionCandidate::new("custom1"),
CompletionCandidate::new("custom2"),
CompletionCandidate::new("custom3"),
CompletionCandidate::new("foo"),
CompletionCandidate::new("bar"),
CompletionCandidate::new("baz"),
]
}

Expand All @@ -594,9 +594,17 @@ fn suggest_custom_arg_value() {
assert_data_eq!(
complete!(cmd, "--custom [TAB]"),
snapbox::str![[r#"
custom1
custom2
custom3
foo
bar
baz
"#]],
);

assert_data_eq!(
complete!(cmd, "--custom b[TAB]"),
snapbox::str![[r#"
bar
baz
"#]],
);
}
Expand Down

0 comments on commit 431e2bc

Please sign in to comment.