Skip to content

Commit 431e2bc

Browse files
committed
test(complete): Ensure ArgValueCandidates get filtered
1 parent 9bef077 commit 431e2bc

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

clap_complete/tests/testsuite/engine.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,9 @@ d_dir/
579579
fn suggest_custom_arg_value() {
580580
fn custom_completer() -> Vec<CompletionCandidate> {
581581
vec![
582-
CompletionCandidate::new("custom1"),
583-
CompletionCandidate::new("custom2"),
584-
CompletionCandidate::new("custom3"),
582+
CompletionCandidate::new("foo"),
583+
CompletionCandidate::new("bar"),
584+
CompletionCandidate::new("baz"),
585585
]
586586
}
587587

@@ -594,9 +594,17 @@ fn suggest_custom_arg_value() {
594594
assert_data_eq!(
595595
complete!(cmd, "--custom [TAB]"),
596596
snapbox::str![[r#"
597-
custom1
598-
custom2
599-
custom3
597+
foo
598+
bar
599+
baz
600+
"#]],
601+
);
602+
603+
assert_data_eq!(
604+
complete!(cmd, "--custom b[TAB]"),
605+
snapbox::str![[r#"
606+
bar
607+
baz
600608
"#]],
601609
);
602610
}

0 commit comments

Comments
 (0)