Add completes_associated_const test

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
hi-rustin 2022-03-15 21:54:45 +08:00
parent 37d0c722ef
commit a9aae250ed

View file

@ -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![[""]],
)
}