Skip to content

Commit 2dc8561

Browse files
committed
one more invalidation test
1 parent bcb6fab commit 2dc8561

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

crates/ra_hir/src/nameres/tests.rs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,43 @@ fn typing_inside_a_function_should_not_invalidate_item_map() {
368368
mod foo;
369369
370370
use crate::foo::bar::Baz;
371-
371+
{
372372
fn foo() -> i32 { 92 }
373373
",
374374
);
375375
}
376376

377+
#[test]
378+
fn adding_inner_items_should_not_invalidate_item_map() {
379+
check_item_map_is_not_recomputed(
380+
"
381+
//- /lib.rs
382+
struct S { a: i32}
383+
mod foo;<|>
384+
enum E { A }
385+
use crate::foo::bar::Baz;
386+
trait T {
387+
fn a() {}
388+
}
389+
//- /foo/mod.rs
390+
pub mod bar;
391+
392+
//- /foo/bar.rs
393+
pub struct Baz;
394+
",
395+
"
396+
struct S { a: i32, b: () }
397+
mod foo;<|>
398+
enum E { A, B }
399+
use crate::foo::bar::Baz;
400+
trait T {
401+
fn a() {}
402+
fn b() {}
403+
}
404+
",
405+
);
406+
}
407+
377408
#[test]
378409
fn typing_inside_a_function_inside_a_macro_should_not_invalidate_item_map() {
379410
check_item_map_is_not_recomputed(

0 commit comments

Comments
 (0)