aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/nameres/tests')
-rw-r--r--crates/ra_hir_def/src/nameres/tests/mod_resolution.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
index e800cc68e..22103ab29 100644
--- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
+++ b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
@@ -53,6 +53,51 @@ fn nested_module_resolution() {
53} 53}
54 54
55#[test] 55#[test]
56fn nested_module_resolution_2() {
57 let map = def_map(
58 "
59 //- /lib.rs
60 mod prelude;
61 mod iter;
62
63 //- /prelude.rs
64 pub use crate::iter::Iterator;
65
66 //- /iter.rs
67 pub use self::traits::Iterator;
68 mod traits;
69
70 //- /iter/traits.rs
71 pub use self::iterator::Iterator;
72 mod iterator;
73
74 //- /iter/traits/iterator.rs
75 pub trait Iterator;
76 ",
77 );
78
79 assert_snapshot!(map, @r###"
80 crate
81 iter: t
82 prelude: t
83
84 crate::iter
85 Iterator: t
86 traits: t
87
88 crate::iter::traits
89 Iterator: t
90 iterator: t
91
92 crate::iter::traits::iterator
93 Iterator: t
94
95 crate::prelude
96 Iterator: t
97 "###);
98}
99
100#[test]
56fn module_resolution_works_for_non_standard_filenames() { 101fn module_resolution_works_for_non_standard_filenames() {
57 let map = def_map( 102 let map = def_map(
58 " 103 "