Skip to content

Commit

Permalink
add test coverage for separate clippy prefixes
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Nov 10, 2024
1 parent 6643586 commit 469c8ba
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,23 @@ fn order_of_clippy_rules() {
assert_eq!(expected, actual);
}

#[test]
fn clippy_rule_separate_prefix() {
let args =
vec!["clippy".to_string(), "-A clippy:all".to_string(), "-W clippy::style".to_string()];
let config = Config::parse(Flags::parse(&args));

let actual = match &config.cmd {
crate::Subcommand::Clippy { allow, deny, warn, forbid, .. } => {
get_clippy_rules_in_order(&args, &allow, &deny, &warn, &forbid)
}
_ => panic!("invalid subcommand"),
};

let expected = vec!["-A clippy:all".to_string(), "-W clippy::style".to_string()];
assert_eq!(expected, actual);
}

#[test]
fn verbose_tests_default_value() {
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into()]));
Expand Down

0 comments on commit 469c8ba

Please sign in to comment.