diff options
| author | hi-rustin <rustin.liu@gmail.com> | 2022-03-15 21:54:45 +0800 |
|---|---|---|
| committer | hi-rustin <rustin.liu@gmail.com> | 2022-03-17 20:39:00 +0800 |
| commit | a9aae250ed8034ab78a9c1b42df62ef9fc0df0e8 (patch) | |
| tree | faddc6334de739ea77d61acdf10f98745e40ebe4 | |
| parent | 37d0c722ef3d6b22fded312474db8520bd48126f (diff) | |
| download | rust-a9aae250ed8034ab78a9c1b42df62ef9fc0df0e8.tar.gz rust-a9aae250ed8034ab78a9c1b42df62ef9fc0df0e8.zip | |
Add completes_associated_const test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
| -rw-r--r-- | crates/ide_completion/src/tests/pattern.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/ide_completion/src/tests/pattern.rs b/crates/ide_completion/src/tests/pattern.rs index 50d5e01979b..c1c73aaf618 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![[""]], + ) +} |
