Skip to content

Commit 469c8ba

Browse files
committed
add test coverage for separate clippy prefixes
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 6643586 commit 469c8ba

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎src/bootstrap/src/core/config/tests.rs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,23 @@ fn order_of_clippy_rules() {
323323
assert_eq!(expected, actual);
324324
}
325325

326+
#[test]
327+
fnclippy_rule_separate_prefix(){
328+
let args =
329+
vec!["clippy".to_string(),"-A clippy:all".to_string(),"-W clippy::style".to_string()];
330+
let config = Config::parse(Flags::parse(&args));
331+
332+
let actual = match&config.cmd{
333+
crate::Subcommand::Clippy{ allow, deny, warn, forbid, .. } => {
334+
get_clippy_rules_in_order(&args,&allow,&deny,&warn,&forbid)
335+
}
336+
_ => panic!("invalid subcommand"),
337+
};
338+
339+
let expected = vec!["-A clippy:all".to_string(),"-W clippy::style".to_string()];
340+
assert_eq!(expected, actual);
341+
}
342+
326343
#[test]
327344
fnverbose_tests_default_value(){
328345
let config = Config::parse(Flags::parse(&["build".into(),"compiler".into()]));

0 commit comments

Comments
 (0)