Skip to content

Commit 469c8ba

Browse files
committed
add test coverage for separate clippy prefixes
Signed-off-by: onur-ozkan <[email protected]>
1 parent 6643586 commit 469c8ba

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

+17
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+
fn clippy_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
fn verbose_tests_default_value() {
328345
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into()]));

0 commit comments

Comments
 (0)