@@ -324,10 +324,10 @@ mod tests {
324324 /// * a diagnostic is produced
325325 /// * this diagnostic touches the input cursor position
326326 /// * that the contents of the file containing the cursor match `after` after the diagnostic fix is applied
327- fn check_apply_diagnostic_fix_from_position ( fixture : & str , after : & str ) {
327+ fn check_apply_diagnostic_fix_from_position ( ra_fixture : & str , after : & str ) {
328328 let after = trim_indent ( after) ;
329329
330- let ( analysis, file_position) = analysis_and_position ( fixture ) ;
330+ let ( analysis, file_position) = analysis_and_position ( ra_fixture ) ;
331331 let diagnostic = analysis. diagnostics ( file_position. file_id ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
332332 let mut fix = diagnostic. fix . unwrap ( ) ;
333333 let edit = fix. source_change . source_file_edits . pop ( ) . unwrap ( ) . edit ;
@@ -365,14 +365,14 @@ mod tests {
365365
366366 /// Takes a multi-file input fixture with annotated cursor position and checks that no diagnostics
367367 /// apply to the file containing the cursor.
368- fn check_no_diagnostic_for_target_file ( fixture : & str ) {
369- let ( analysis, file_position) = analysis_and_position ( fixture ) ;
368+ fn check_no_diagnostic_for_target_file ( ra_fixture : & str ) {
369+ let ( analysis, file_position) = analysis_and_position ( ra_fixture ) ;
370370 let diagnostics = analysis. diagnostics ( file_position. file_id ) . unwrap ( ) ;
371371 assert_eq ! ( diagnostics. len( ) , 0 ) ;
372372 }
373373
374- fn check_no_diagnostic ( content : & str ) {
375- let ( analysis, file_id) = single_file ( content ) ;
374+ fn check_no_diagnostic ( ra_fixture : & str ) {
375+ let ( analysis, file_id) = single_file ( ra_fixture ) ;
376376 let diagnostics = analysis. diagnostics ( file_id) . unwrap ( ) ;
377377 assert_eq ! ( diagnostics. len( ) , 0 , "expected no diagnostic, found one" ) ;
378378 }
@@ -473,7 +473,8 @@ mod tests {
473473
474474 #[ test]
475475 fn test_wrap_return_type_not_applicable_when_expr_type_does_not_match_ok_type ( ) {
476- let content = r#"
476+ check_no_diagnostic_for_target_file (
477+ r"
477478 //- /main.rs
478479 use core::result::Result::{self, Ok, Err};
479480
@@ -485,13 +486,14 @@ mod tests {
485486 pub mod result {
486487 pub enum Result<T, E> { Ok(T), Err(E) }
487488 }
488- "# ;
489- check_no_diagnostic_for_target_file ( content ) ;
489+ " ,
490+ ) ;
490491 }
491492
492493 #[ test]
493494 fn test_wrap_return_type_not_applicable_when_return_type_is_not_result ( ) {
494- let content = r#"
495+ check_no_diagnostic_for_target_file (
496+ r"
495497 //- /main.rs
496498 use core::result::Result::{self, Ok, Err};
497499
@@ -508,8 +510,8 @@ mod tests {
508510 pub mod result {
509511 pub enum Result<T, E> { Ok(T), Err(E) }
510512 }
511- "# ;
512- check_no_diagnostic_for_target_file ( content ) ;
513+ " ,
514+ ) ;
513515 }
514516
515517 #[ test]
@@ -618,7 +620,8 @@ mod tests {
618620
619621 #[ test]
620622 fn test_fill_struct_fields_no_diagnostic ( ) {
621- let content = r"
623+ check_no_diagnostic (
624+ r"
622625 struct TestStruct {
623626 one: i32,
624627 two: i64,
@@ -628,14 +631,14 @@ mod tests {
628631 let one = 1;
629632 let s = TestStruct{ one, two: 2 };
630633 }
631- " ;
632-
633- check_no_diagnostic ( content) ;
634+ " ,
635+ ) ;
634636 }
635637
636638 #[ test]
637639 fn test_fill_struct_fields_no_diagnostic_on_spread ( ) {
638- let content = r"
640+ check_no_diagnostic (
641+ r"
639642 struct TestStruct {
640643 one: i32,
641644 two: i64,
@@ -645,9 +648,8 @@ mod tests {
645648 let one = 1;
646649 let s = TestStruct{ ..a };
647650 }
648- " ;
649-
650- check_no_diagnostic ( content) ;
651+ " ,
652+ ) ;
651653 }
652654
653655 #[ test]
0 commit comments