Add test module for update_lints
This commit is contained in:
@@ -526,6 +526,10 @@ declare_deprecated_lint! {
|
|||||||
assert_eq!(expected, result);
|
assert_eq!(expected, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_replace_region() {
|
fn test_replace_region() {
|
||||||
let text = "\nabc\n123\n789\ndef\nghi";
|
let text = "\nabc\n123\n789\ndef\nghi";
|
||||||
@@ -667,7 +671,8 @@ fn test_gen_modules_list() {
|
|||||||
Lint::new("should_assert_eq", "group1", "abc", None, "module_name"),
|
Lint::new("should_assert_eq", "group1", "abc", None, "module_name"),
|
||||||
Lint::new("incorrect_stuff", "group3", "abc", None, "another_module"),
|
Lint::new("incorrect_stuff", "group3", "abc", None, "another_module"),
|
||||||
];
|
];
|
||||||
let expected = GENERATED_FILE_COMMENT.to_string() + &["mod another_module;", "mod module_name;"].join("\n") + "\n";
|
let expected =
|
||||||
|
GENERATED_FILE_COMMENT.to_string() + &["mod another_module;", "mod module_name;"].join("\n") + "\n";
|
||||||
assert_eq!(expected, gen_modules_list(lints.iter()));
|
assert_eq!(expected, gen_modules_list(lints.iter()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -693,3 +698,4 @@ fn test_gen_lint_group_list() {
|
|||||||
|
|
||||||
assert_eq!(expected, result);
|
assert_eq!(expected, result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user