From 431e2bc931b6721471fad18866f52fefe7d6572c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 21 Aug 2024 13:52:13 -0500 Subject: [PATCH] test(complete): Ensure ArgValueCandidates get filtered --- clap_complete/tests/testsuite/engine.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/clap_complete/tests/testsuite/engine.rs b/clap_complete/tests/testsuite/engine.rs index 5fc363b0c62..ed70bd0931c 100644 --- a/clap_complete/tests/testsuite/engine.rs +++ b/clap_complete/tests/testsuite/engine.rs @@ -579,9 +579,9 @@ d_dir/ fn suggest_custom_arg_value() { fn custom_completer() -> Vec { vec![ - CompletionCandidate::new("custom1"), - CompletionCandidate::new("custom2"), - CompletionCandidate::new("custom3"), + CompletionCandidate::new("foo"), + CompletionCandidate::new("bar"), + CompletionCandidate::new("baz"), ] } @@ -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 "#]], ); }