From b7aaefb5a4a44985dc80a502209ea3f08a543b90 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 26 Mar 2020 15:44:31 +0100 Subject: Minor incremental tests cleanup --- crates/ra_db/src/fixture.rs | 4 ++-- crates/ra_hir_def/src/nameres/tests/incremental.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'crates') diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 3464f43df..5e3e9203c 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs @@ -28,9 +28,9 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static { db } - fn with_position(fixture: &str) -> (Self, FilePosition) { + fn with_position(ra_fixture: &str) -> (Self, FilePosition) { let mut db = Self::default(); - let pos = with_files(&mut db, fixture); + let pos = with_files(&mut db, ra_fixture); (db, pos.unwrap()) } diff --git a/crates/ra_hir_def/src/nameres/tests/incremental.rs b/crates/ra_hir_def/src/nameres/tests/incremental.rs index 83f429c29..496fc6b08 100644 --- a/crates/ra_hir_def/src/nameres/tests/incremental.rs +++ b/crates/ra_hir_def/src/nameres/tests/incremental.rs @@ -4,8 +4,8 @@ use ra_db::SourceDatabaseExt; use super::*; -fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) { - let (mut db, pos) = TestDB::with_position(initial); +fn check_def_map_is_not_recomputed(ra_fixture_initial: &str, ra_fixture_change: &str) { + let (mut db, pos) = TestDB::with_position(ra_fixture_initial); let krate = db.test_crate(); { let events = db.log_executed(|| { @@ -13,7 +13,7 @@ fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) { }); assert!(format!("{:?}", events).contains("crate_def_map"), "{:#?}", events) } - db.set_file_text(pos.file_id, Arc::new(file_change.to_string())); + db.set_file_text(pos.file_id, Arc::new(ra_fixture_change.to_string())); { let events = db.log_executed(|| { @@ -26,7 +26,7 @@ fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) { #[test] fn typing_inside_a_function_should_not_invalidate_def_map() { check_def_map_is_not_recomputed( - " + r" //- /lib.rs mod foo;<|> @@ -41,7 +41,7 @@ fn typing_inside_a_function_should_not_invalidate_def_map() { //- /foo/bar.rs pub struct Baz; ", - " + r" mod foo; use crate::foo::bar::Baz; @@ -54,7 +54,7 @@ fn typing_inside_a_function_should_not_invalidate_def_map() { #[test] fn adding_inner_items_should_not_invalidate_def_map() { check_def_map_is_not_recomputed( - " + r" //- /lib.rs struct S { a: i32} enum E { A } @@ -72,7 +72,7 @@ fn adding_inner_items_should_not_invalidate_def_map() { //- /foo/bar.rs pub struct Baz; ", - " + r" struct S { a: i32, b: () } enum E { A, B } trait T { @@ -92,7 +92,7 @@ fn adding_inner_items_should_not_invalidate_def_map() { #[test] fn typing_inside_a_macro_should_not_invalidate_def_map() { let (mut db, pos) = TestDB::with_position( - " + r" //- /lib.rs macro_rules! m { ($ident:ident) => { -- cgit v1.2.3