Prevent multiple incorrect case diagnostics in functions

This commit is contained in:
unexge 2020-12-23 22:18:31 +03:00
parent 3d5d21b602
commit bfae2634b4
2 changed files with 16 additions and 3 deletions

View file

@ -895,4 +895,17 @@ impl TestStruct {
"#,
);
}
#[test]
fn test_single_incorrect_case_diagnostic_in_function_name_issue_6970() {
let input = r#"fn FOO<|>() {}"#;
let expected = r#"fn foo() {}"#;
let (analysis, file_position) = fixture::position(input);
let diagnostics =
analysis.diagnostics(&DiagnosticsConfig::default(), file_position.file_id).unwrap();
assert_eq!(diagnostics.len(), 1);
check_fixes(input, expected);
}
}