File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,29 @@ For more information, try '--help'.
150
150
assert_error ( err, expected_kind, MESSAGE , true ) ;
151
151
}
152
152
153
+ #[ test]
154
+ #[ cfg( feature = "error-context" ) ]
155
+ fn suggest_trailing_last ( ) {
156
+ let cmd = Command :: new ( "cargo" )
157
+ . arg ( arg ! ( [ TESTNAME ] ) . last ( true ) )
158
+ . arg ( arg ! ( --"ignore-rust-version" ) ) ;
159
+
160
+ let res = cmd. try_get_matches_from ( [ "cargo" , "--ignored" ] ) ;
161
+ assert ! ( res. is_err( ) ) ;
162
+ let err = res. unwrap_err ( ) ;
163
+ let expected_kind = ErrorKind :: UnknownArgument ;
164
+ static MESSAGE : & str = "\
165
+ error: unexpected argument '--ignored' found
166
+
167
+ tip: a similar argument exists: '--ignore-rust-version'
168
+
169
+ Usage: cargo --ignore-rust-version [-- <TESTNAME>]
170
+
171
+ For more information, try '--help'.
172
+ " ;
173
+ assert_error ( err, expected_kind, MESSAGE , true ) ;
174
+ }
175
+
153
176
#[ test]
154
177
#[ cfg( feature = "error-context" ) ]
155
178
fn trailing_already_in_use ( ) {
You can’t perform that action at this time.
0 commit comments