aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-08 21:54:06 +0000
committerAleksey Kladov <[email protected]>2019-01-08 21:54:06 +0000
commit2dc85619beaa3cd9fc47bb8ac1791820691e1205 (patch)
treeabbc3144715ea17006d125d2e57f7917d033abe8 /crates/ra_hir/src/nameres
parentbcb6fabd15d2767c21b6a4f9d00389341ec6731e (diff)
one more invalidation test
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/tests.rs33
1 files changed, 32 insertions, 1 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 0e9026a01..a19a6fe51 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -368,13 +368,44 @@ fn typing_inside_a_function_should_not_invalidate_item_map() {
368 mod foo; 368 mod foo;
369 369
370 use crate::foo::bar::Baz; 370 use crate::foo::bar::Baz;
371 371{
372 fn foo() -> i32 { 92 } 372 fn foo() -> i32 { 92 }
373 ", 373 ",
374 ); 374 );
375} 375}
376 376
377#[test] 377#[test]
378fn 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
408#[test]
378fn typing_inside_a_function_inside_a_macro_should_not_invalidate_item_map() { 409fn typing_inside_a_function_inside_a_macro_should_not_invalidate_item_map() {
379 check_item_map_is_not_recomputed( 410 check_item_map_is_not_recomputed(
380 " 411 "