diff options
author | Aleksey Kladov <[email protected]> | 2019-01-10 13:45:09 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-10 13:45:09 +0000 |
commit | 32fa084c07375c7a596e0bfceddbef1830ae23e7 (patch) | |
tree | 367522218a1dd58880fa187419c22d37bd035324 /crates/ra_hir/src/nameres/tests.rs | |
parent | aca14c591fea40b2f803bbf5f02c1571732348fb (diff) |
introduce marking infrastructure for maintainable tests
This also fixes a particular edge case in name resolution.
Diffstat (limited to 'crates/ra_hir/src/nameres/tests.rs')
-rw-r--r-- | crates/ra_hir/src/nameres/tests.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index 17de54b44..ba9fcb3d1 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs | |||
@@ -137,6 +137,35 @@ fn re_exports() { | |||
137 | } | 137 | } |
138 | 138 | ||
139 | #[test] | 139 | #[test] |
140 | fn name_res_works_for_broken_modules() { | ||
141 | covers!(name_res_works_for_broken_modules); | ||
142 | let (item_map, module_id) = item_map( | ||
143 | " | ||
144 | //- /lib.rs | ||
145 | mod foo // no `;`, no body | ||
146 | |||
147 | use self::foo::Baz; | ||
148 | <|> | ||
149 | |||
150 | //- /foo/mod.rs | ||
151 | pub mod bar; | ||
152 | |||
153 | pub use self::bar::Baz; | ||
154 | |||
155 | //- /foo/bar.rs | ||
156 | pub struct Baz; | ||
157 | ", | ||
158 | ); | ||
159 | check_module_item_map( | ||
160 | &item_map, | ||
161 | module_id, | ||
162 | " | ||
163 | Baz: _ | ||
164 | ", | ||
165 | ); | ||
166 | } | ||
167 | |||
168 | #[test] | ||
140 | fn item_map_contains_items_from_expansions() { | 169 | fn item_map_contains_items_from_expansions() { |
141 | let (item_map, module_id) = item_map( | 170 | let (item_map, module_id) = item_map( |
142 | " | 171 | " |