]> git.lizzy.rs Git - rust.git/commitdiff
Add completes_associated_const test
authorhi-rustin <rustin.liu@gmail.com>
Tue, 15 Mar 2022 13:54:45 +0000 (21:54 +0800)
committerhi-rustin <rustin.liu@gmail.com>
Thu, 17 Mar 2022 12:39:00 +0000 (20:39 +0800)
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
crates/ide_completion/src/tests/pattern.rs

index 50d5e01979bd5a6f1423cfb1058d9b4761eba723..c1c73aaf618f286ba5c9bb10ddbfed8a6d5a9f81 100644 (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![[""]],
+    )
+}