mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
Prevent multiple incorrect case diagnostics in functions
This commit is contained in:
parent
3d5d21b602
commit
bfae2634b4
2 changed files with 16 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue