aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-01 23:17:48 +0000
committerFlorian Diebold <[email protected]>2019-02-01 23:23:53 +0000
commitaa5f6a1ee8b56343e9f3dc9b1578d56f29dd2bc8 (patch)
tree62a9ae5e1a62c4e4ae4744aa631eee7e2f9765df /crates/ra_hir/src/nameres
parent4447019f4b5f24728bb7b91b161755ddb373c74c (diff)
Add test for `use as`
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/tests.rs24
1 files changed, 24 insertions, 0 deletions
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
@@ -91,6 +91,30 @@ fn item_map_smoke_test() {
91} 91}
92 92
93#[test] 93#[test]
94fn use_as() {
95 let (item_map, module_id) = item_map(
96 "
97 //- /lib.rs
98 mod foo;
99
100 use crate::foo::Baz as Foo;
101 <|>
102
103 //- /foo/mod.rs
104 pub struct Baz;
105 ",
106 );
107 check_module_item_map(
108 &item_map,
109 module_id,
110 "
111 Foo: t v
112 foo: t
113 ",
114 );
115}
116
117#[test]
94fn use_trees() { 118fn use_trees() {
95 let (item_map, module_id) = item_map( 119 let (item_map, module_id) = item_map(
96 " 120 "