From 34db4edb80ac614f5ca8d4e7bea4b6917368d6d6 Mon Sep 17 00:00:00 2001 From: Toby Dimmick Date: Sun, 14 Jun 2020 22:43:16 +0100 Subject: fill_match_arms bind pattern test --- crates/ra_assists/src/handlers/fill_match_arms.rs | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'crates') diff --git a/crates/ra_assists/src/handlers/fill_match_arms.rs b/crates/ra_assists/src/handlers/fill_match_arms.rs index cc303285b..9905b9e9f 100644 --- a/crates/ra_assists/src/handlers/fill_match_arms.rs +++ b/crates/ra_assists/src/handlers/fill_match_arms.rs @@ -350,6 +350,40 @@ mod tests { ); } + #[test] + fn partial_fill_bind_pat() { + check_assist( + fill_match_arms, + r#" + enum A { + As, + Bs, + Cs(Option), + } + fn main() { + match A::As<|> { + A::As(_) => {} + a @ A::Bs(_) => {} + } + } + "#, + r#" + enum A { + As, + Bs, + Cs(Option), + } + fn main() { + match A::As { + A::As(_) => {} + a @ A::Bs(_) => {} + $0A::Cs(_) => {} + } + } + "#, + ); + } + #[test] fn fill_match_arms_empty_body() { check_assist( -- cgit v1.2.3