one more invalidation test

This commit is contained in:
Aleksey Kladov 2019-01-09 00:54:06 +03:00
parent bcb6fabd15
commit 2dc85619be

View file

@ -368,12 +368,43 @@ fn typing_inside_a_function_should_not_invalidate_item_map() {
mod foo; mod foo;
use crate::foo::bar::Baz; use crate::foo::bar::Baz;
{
fn foo() -> i32 { 92 } fn foo() -> i32 { 92 }
", ",
); );
} }
#[test]
fn adding_inner_items_should_not_invalidate_item_map() {
check_item_map_is_not_recomputed(
"
//- /lib.rs
struct S { a: i32}
mod foo;<|>
enum E { A }
use crate::foo::bar::Baz;
trait T {
fn a() {}
}
//- /foo/mod.rs
pub mod bar;
//- /foo/bar.rs
pub struct Baz;
",
"
struct S { a: i32, b: () }
mod foo;<|>
enum E { A, B }
use crate::foo::bar::Baz;
trait T {
fn a() {}
fn b() {}
}
",
);
}
#[test] #[test]
fn typing_inside_a_function_inside_a_macro_should_not_invalidate_item_map() { fn typing_inside_a_function_inside_a_macro_should_not_invalidate_item_map() {
check_item_map_is_not_recomputed( check_item_map_is_not_recomputed(