aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/tests.rs31
1 files changed, 30 insertions, 1 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index dcbe65aec..04faec4fb 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -35,7 +35,7 @@ fn check_module_item_map(map: &hir::ItemMap, module_id: hir::ModuleId, expected:
35 .map(|it| it.trim()) 35 .map(|it| it.trim())
36 .collect::<Vec<_>>() 36 .collect::<Vec<_>>()
37 .join("\n"); 37 .join("\n");
38 assert_eq_text!(&actual, &expected); 38 assert_eq_text!(&expected, &actual);
39 39
40 fn dump_resolution(resolution: &hir::Resolution) -> &'static str { 40 fn dump_resolution(resolution: &hir::Resolution) -> &'static str {
41 match ( 41 match (
@@ -78,6 +78,35 @@ fn item_map_smoke_test() {
78} 78}
79 79
80#[test] 80#[test]
81fn re_exports() {
82 let (item_map, module_id) = item_map(
83 "
84 //- /lib.rs
85 mod foo;
86
87 use self::foo::Baz;
88 <|>
89
90 //- /foo/mod.rs
91 pub mod bar;
92
93 pub use self::bar::Baz;
94
95 //- /foo/bar.rs
96 pub struct Baz;
97 ",
98 );
99 check_module_item_map(
100 &item_map,
101 module_id,
102 "
103 Baz: t v
104 foo: t
105 ",
106 );
107}
108
109#[test]
81fn item_map_contains_items_from_expansions() { 110fn item_map_contains_items_from_expansions() {
82 let (item_map, module_id) = item_map( 111 let (item_map, module_id) = item_map(
83 " 112 "