mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
add test coverage for separate clippy prefixes
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
parent
6643586a1d
commit
469c8baab8
@ -323,6 +323,23 @@ fn order_of_clippy_rules() {
|
|||||||
assert_eq!(expected, actual);
|
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]
|
#[test]
|
||||||
fn verbose_tests_default_value() {
|
fn verbose_tests_default_value() {
|
||||||
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into()]));
|
let config = Config::parse(Flags::parse(&["build".into(), "compiler".into()]));
|
||||||
|
Loading…
Reference in New Issue
Block a user