File tree 1 file changed +25
-0
lines changed
clap_complete/tests/testsuite
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,31 @@ hello-world-foo"
122
122
) ;
123
123
}
124
124
125
+ #[ test]
126
+ fn suggest_hidden_possible_value ( ) {
127
+ let mut cmd = Command :: new ( "exhaustive" ) . arg (
128
+ clap:: Arg :: new ( "possible_value" ) . long ( "test" ) . value_parser ( [
129
+ PossibleValue :: new ( "test-visible" ) . help ( "Say hello to the world" ) ,
130
+ PossibleValue :: new ( "test-hidden" )
131
+ . help ( "Say hello to the moon" )
132
+ . hide ( true ) ,
133
+ ] ) ,
134
+ ) ;
135
+
136
+ assert_data_eq ! (
137
+ complete!( cmd, "--test=test" ) ,
138
+ snapbox:: str ![
139
+ "--test=test-visible\t Say hello to the world
140
+ --test=test-hidden\t Say hello to the moon"
141
+ ]
142
+ ) ;
143
+
144
+ assert_data_eq ! (
145
+ complete!( cmd, "--test=test-h" ) ,
146
+ snapbox:: str ![ "--test=test-hidden\t Say hello to the moon" ]
147
+ )
148
+ }
149
+
125
150
#[ test]
126
151
fn suggest_hidden_long_flag_aliases ( ) {
127
152
let mut cmd = Command :: new ( "exhaustive" )
You can’t perform that action at this time.
0 commit comments