diff options
Diffstat (limited to 'crates/ra_hir_def/src/nameres/tests')
-rw-r--r-- | crates/ra_hir_def/src/nameres/tests/globs.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/nameres/tests/globs.rs b/crates/ra_hir_def/src/nameres/tests/globs.rs index 2f440975a..d5a02137c 100644 --- a/crates/ra_hir_def/src/nameres/tests/globs.rs +++ b/crates/ra_hir_def/src/nameres/tests/globs.rs | |||
@@ -276,3 +276,49 @@ fn glob_shadowed_def() { | |||
276 | "### | 276 | "### |
277 | ); | 277 | ); |
278 | } | 278 | } |
279 | |||
280 | #[test] | ||
281 | fn glob_shadowed_def_reversed() { | ||
282 | let map = def_map( | ||
283 | r###" | ||
284 | //- /lib.rs | ||
285 | mod foo; | ||
286 | mod bar; | ||
287 | |||
288 | use bar::baz; | ||
289 | use foo::*; | ||
290 | |||
291 | use baz::Bar; | ||
292 | |||
293 | //- /foo.rs | ||
294 | pub mod baz { | ||
295 | pub struct Foo; | ||
296 | } | ||
297 | |||
298 | //- /bar.rs | ||
299 | pub mod baz { | ||
300 | pub struct Bar; | ||
301 | } | ||
302 | "###, | ||
303 | ); | ||
304 | assert_snapshot!(map, @r###" | ||
305 | ⋮crate | ||
306 | ⋮Bar: t v | ||
307 | ⋮bar: t | ||
308 | ⋮baz: t | ||
309 | ⋮foo: t | ||
310 | ⋮ | ||
311 | ⋮crate::bar | ||
312 | ⋮baz: t | ||
313 | ⋮ | ||
314 | ⋮crate::bar::baz | ||
315 | ⋮Bar: t v | ||
316 | ⋮ | ||
317 | ⋮crate::foo | ||
318 | ⋮baz: t | ||
319 | ⋮ | ||
320 | ⋮crate::foo::baz | ||
321 | ⋮Foo: t v | ||
322 | "### | ||
323 | ); | ||
324 | } | ||