diff options
Diffstat (limited to 'crates/ra_hir/src/module/nameres/tests.rs')
-rw-r--r-- | crates/ra_hir/src/module/nameres/tests.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_hir/src/module/nameres/tests.rs b/crates/ra_hir/src/module/nameres/tests.rs index 9fa9146e3..3e29c3954 100644 --- a/crates/ra_hir/src/module/nameres/tests.rs +++ b/crates/ra_hir/src/module/nameres/tests.rs | |||
@@ -44,6 +44,25 @@ fn item_map_smoke_test() { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | #[test] | 46 | #[test] |
47 | fn test_self() { | ||
48 | let (item_map, module_id) = item_map( | ||
49 | " | ||
50 | //- /lib.rs | ||
51 | mod foo; | ||
52 | use crate::foo::bar::Baz::{self}; | ||
53 | <|> | ||
54 | //- /foo/mod.rs | ||
55 | pub mod bar; | ||
56 | //- /foo/bar.rs | ||
57 | pub struct Baz; | ||
58 | ", | ||
59 | ); | ||
60 | let name = SmolStr::from("Baz"); | ||
61 | let resolution = &item_map.per_module[&module_id].items[&name]; | ||
62 | assert!(resolution.def_id.is_some()); | ||
63 | } | ||
64 | |||
65 | #[test] | ||
47 | fn item_map_across_crates() { | 66 | fn item_map_across_crates() { |
48 | let (mut db, sr) = MockDatabase::with_files( | 67 | let (mut db, sr) = MockDatabase::with_files( |
49 | " | 68 | " |