Skip to content

Commit 539e597

Browse files
bors[bot]matklad
andauthored
Merge #3733
3733: Minor incremental tests cleanup r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents a23b474 + b7aaefb commit 539e597

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

crates/ra_db/src/fixture.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static {
2828
db
2929
}
3030

31-
fn with_position(fixture: &str) -> (Self, FilePosition) {
31+
fn with_position(ra_fixture: &str) -> (Self, FilePosition) {
3232
let mut db = Self::default();
33-
let pos = with_files(&mut db, fixture);
33+
let pos = with_files(&mut db, ra_fixture);
3434
(db, pos.unwrap())
3535
}
3636

crates/ra_hir_def/src/nameres/tests/incremental.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ use ra_db::SourceDatabaseExt;
44

55
use super::*;
66

7-
fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) {
8-
let (mut db, pos) = TestDB::with_position(initial);
7+
fn check_def_map_is_not_recomputed(ra_fixture_initial: &str, ra_fixture_change: &str) {
8+
let (mut db, pos) = TestDB::with_position(ra_fixture_initial);
99
let krate = db.test_crate();
1010
{
1111
let events = db.log_executed(|| {
1212
db.crate_def_map(krate);
1313
});
1414
assert!(format!("{:?}", events).contains("crate_def_map"), "{:#?}", events)
1515
}
16-
db.set_file_text(pos.file_id, Arc::new(file_change.to_string()));
16+
db.set_file_text(pos.file_id, Arc::new(ra_fixture_change.to_string()));
1717

1818
{
1919
let events = db.log_executed(|| {
@@ -26,7 +26,7 @@ fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) {
2626
#[test]
2727
fn typing_inside_a_function_should_not_invalidate_def_map() {
2828
check_def_map_is_not_recomputed(
29-
"
29+
r"
3030
//- /lib.rs
3131
mod foo;<|>
3232
@@ -41,7 +41,7 @@ fn typing_inside_a_function_should_not_invalidate_def_map() {
4141
//- /foo/bar.rs
4242
pub struct Baz;
4343
",
44-
"
44+
r"
4545
mod foo;
4646
4747
use crate::foo::bar::Baz;
@@ -54,7 +54,7 @@ fn typing_inside_a_function_should_not_invalidate_def_map() {
5454
#[test]
5555
fn adding_inner_items_should_not_invalidate_def_map() {
5656
check_def_map_is_not_recomputed(
57-
"
57+
r"
5858
//- /lib.rs
5959
struct S { a: i32}
6060
enum E { A }
@@ -72,7 +72,7 @@ fn adding_inner_items_should_not_invalidate_def_map() {
7272
//- /foo/bar.rs
7373
pub struct Baz;
7474
",
75-
"
75+
r"
7676
struct S { a: i32, b: () }
7777
enum E { A, B }
7878
trait T {
@@ -92,7 +92,7 @@ fn adding_inner_items_should_not_invalidate_def_map() {
9292
#[test]
9393
fn typing_inside_a_macro_should_not_invalidate_def_map() {
9494
let (mut db, pos) = TestDB::with_position(
95-
"
95+
r"
9696
//- /lib.rs
9797
macro_rules! m {
9898
($ident:ident) => {

0 commit comments

Comments
 (0)