From a9aae250ed8034ab78a9c1b42df62ef9fc0df0e8 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Tue, 15 Mar 2022 21:54:45 +0800 Subject: [PATCH] Add completes_associated_const test Signed-off-by: hi-rustin --- crates/ide_completion/src/tests/pattern.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/crates/ide_completion/src/tests/pattern.rs b/crates/ide_completion/src/tests/pattern.rs index 50d5e01979..c1c73aaf61 100644 --- a/crates/ide_completion/src/tests/pattern.rs +++ b/crates/ide_completion/src/tests/pattern.rs @@ -444,3 +444,25 @@ fn foo() { expect![[r#""#]], ); } + +#[test] +fn completes_associated_const() { + check_empty( + r#" +#[derive(PartialEq, Eq)] +struct Ty(u8); + +impl Ty { + const ABC: Self = Self(0); +} + +fn f(t: Ty) { + match t { + Ty::$0 => {} + _ => {} + } +} +"#, + expect![[""]], + ) +}