From dc186c0fcca5155a4b11aeb8b48ebcf68ef9c82c Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 7 Jan 2019 19:40:31 +0100 Subject: Import fixpoint loop for name resolution --- crates/ra_hir/src/nameres/tests.rs | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/nameres/tests.rs') diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index dcbe65aec..04faec4fb 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs @@ -35,7 +35,7 @@ fn check_module_item_map(map: &hir::ItemMap, module_id: hir::ModuleId, expected: .map(|it| it.trim()) .collect::>() .join("\n"); - assert_eq_text!(&actual, &expected); + assert_eq_text!(&expected, &actual); fn dump_resolution(resolution: &hir::Resolution) -> &'static str { match ( @@ -77,6 +77,35 @@ fn item_map_smoke_test() { ); } +#[test] +fn re_exports() { + let (item_map, module_id) = item_map( + " + //- /lib.rs + mod foo; + + use self::foo::Baz; + <|> + + //- /foo/mod.rs + pub mod bar; + + pub use self::bar::Baz; + + //- /foo/bar.rs + pub struct Baz; + ", + ); + check_module_item_map( + &item_map, + module_id, + " + Baz: t v + foo: t + ", + ); +} + #[test] fn item_map_contains_items_from_expansions() { let (item_map, module_id) = item_map( -- cgit v1.2.3