diff options
Diffstat (limited to 'crates/ra_hir/src/nameres/tests')
-rw-r--r-- | crates/ra_hir/src/nameres/tests/mod_resolution.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/tests/mod_resolution.rs b/crates/ra_hir/src/nameres/tests/mod_resolution.rs index 4f8398460..e3e6f1e95 100644 --- a/crates/ra_hir/src/nameres/tests/mod_resolution.rs +++ b/crates/ra_hir/src/nameres/tests/mod_resolution.rs | |||
@@ -706,3 +706,34 @@ fn unresolved_module_diagnostics() { | |||
706 | "### | 706 | "### |
707 | ); | 707 | ); |
708 | } | 708 | } |
709 | |||
710 | #[test] | ||
711 | fn module_resolution_decl_inside_module_in_non_crate_root_2() { | ||
712 | let map = def_map_with_crate_graph( | ||
713 | r###" | ||
714 | //- /main.rs | ||
715 | #[path="module/m2.rs"] | ||
716 | mod module; | ||
717 | |||
718 | //- /module/m2.rs | ||
719 | pub mod submod; | ||
720 | |||
721 | //- /module/submod.rs | ||
722 | pub struct Baz; | ||
723 | "###, | ||
724 | crate_graph! { | ||
725 | "main": ("/main.rs", []), | ||
726 | }, | ||
727 | ); | ||
728 | |||
729 | assert_snapshot!(map, @r###" | ||
730 | ⋮crate | ||
731 | ⋮module: t | ||
732 | ⋮ | ||
733 | ⋮crate::module | ||
734 | ⋮submod: t | ||
735 | ⋮ | ||
736 | ⋮crate::module::submod | ||
737 | ⋮Baz: t v | ||
738 | "###); | ||
739 | } | ||