diff options
author | DJMcNab <[email protected]> | 2018-12-21 22:29:59 +0000 |
---|---|---|
committer | DJMcNab <[email protected]> | 2018-12-21 22:29:59 +0000 |
commit | d8d60215dacc3eeddeda4d6af7007e2129fdb00e (patch) | |
tree | 4caab03638e2a66c06f91d21762b09bab5cdca4a /crates/ra_hir/src/module | |
parent | 67ac0a423f767ce8973348d5188e8baa6979d380 (diff) |
Fix handling of nested self in paths
Diffstat (limited to 'crates/ra_hir/src/module')
-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 | " |