aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/item_tree/tests.rs')
-rw-r--r--crates/hir_def/src/item_tree/tests.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index 100ae9b97..91c44362e 100644
--- a/crates/hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -242,3 +242,49 @@ m!();
242 "#]], 242 "#]],
243 ); 243 );
244} 244}
245
246#[test]
247fn mod_paths() {
248 check(
249 r#"
250struct S {
251 a: self::Ty,
252 b: super::SuperTy,
253 c: super::super::SuperSuperTy,
254 d: ::abs::Path,
255 e: crate::Crate,
256 f: plain::path::Ty,
257}
258 "#,
259 expect![[r#"
260 pub(self) struct S {
261 pub(self) a: self::Ty,
262 pub(self) b: super::SuperTy,
263 pub(self) c: super::super::SuperSuperTy,
264 pub(self) d: ::abs::Path,
265 pub(self) e: crate::Crate,
266 pub(self) f: plain::path::Ty,
267 }
268 "#]],
269 )
270}
271
272#[test]
273fn types() {
274 check(
275 r#"
276struct S {
277 a: Mixed<'a, T, Item=(), OtherItem=u8>,
278 b: <Fully as Qualified>::Syntax,
279 c: <TypeAnchored>::Path::<'a>,
280}
281 "#,
282 expect![[r#"
283 pub(self) struct S {
284 pub(self) a: Mixed<'a, T, Item = (), OtherItem = u8>,
285 pub(self) b: Qualified<Self=Fully>::Syntax,
286 pub(self) c: <TypeAnchored>::Path<'a>,
287 }
288 "#]],
289 )
290}