Make incorrect case diagnostic work inside of functions

This commit is contained in:
Igor Aleksanov 2020-10-04 07:39:35 +03:00
parent 9ec1741b65
commit b42562b5de
4 changed files with 280 additions and 33 deletions

View file

@ -877,6 +877,32 @@ pub fn SomeFn<|>(val: u8) -> u8 {
pub fn some_fn(val: u8) -> u8 {
if val != 0 { some_fn(val - 1) } else { val }
}
"#,
);
check_fixes(
r#"
fn some_fn() {
let whatAWeird_Formatting<|> = 10;
another_func(whatAWeird_Formatting);
}
"#,
r#"
fn some_fn() {
let what_a_weird_formatting = 10;
another_func(what_a_weird_formatting);
}
"#,
);
}
#[test]
fn test_uppercase_const_no_diagnostics() {
check_no_diagnostics(
r#"
fn foo() {
const ANOTHER_ITEM<|>: &str = "some_item";
}
"#,
);
}