From aa5f6a1ee8b56343e9f3dc9b1578d56f29dd2bc8 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 2 Feb 2019 00:17:48 +0100 Subject: Add test for `use as` --- crates/ra_hir/src/nameres/tests.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index 0e0683db7..81c8a4f12 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs @@ -90,6 +90,30 @@ fn item_map_smoke_test() { ); } +#[test] +fn use_as() { + let (item_map, module_id) = item_map( + " + //- /lib.rs + mod foo; + + use crate::foo::Baz as Foo; + <|> + + //- /foo/mod.rs + pub struct Baz; + ", + ); + check_module_item_map( + &item_map, + module_id, + " + Foo: t v + foo: t + ", + ); +} + #[test] fn use_trees() { let (item_map, module_id) = item_map( -- cgit v1.2.3