diff options
-rw-r--r-- | crates/ra_assists/src/handlers/fill_match_arms.rs | 34 |
1 files changed, 34 insertions, 0 deletions
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 | |||
@@ -351,6 +351,40 @@ mod tests { | |||
351 | } | 351 | } |
352 | 352 | ||
353 | #[test] | 353 | #[test] |
354 | fn partial_fill_bind_pat() { | ||
355 | check_assist( | ||
356 | fill_match_arms, | ||
357 | r#" | ||
358 | enum A { | ||
359 | As, | ||
360 | Bs, | ||
361 | Cs(Option<i32>), | ||
362 | } | ||
363 | fn main() { | ||
364 | match A::As<|> { | ||
365 | A::As(_) => {} | ||
366 | a @ A::Bs(_) => {} | ||
367 | } | ||
368 | } | ||
369 | "#, | ||
370 | r#" | ||
371 | enum A { | ||
372 | As, | ||
373 | Bs, | ||
374 | Cs(Option<i32>), | ||
375 | } | ||
376 | fn main() { | ||
377 | match A::As { | ||
378 | A::As(_) => {} | ||
379 | a @ A::Bs(_) => {} | ||
380 | $0A::Cs(_) => {} | ||
381 | } | ||
382 | } | ||
383 | "#, | ||
384 | ); | ||
385 | } | ||
386 | |||
387 | #[test] | ||
354 | fn fill_match_arms_empty_body() { | 388 | fn fill_match_arms_empty_body() { |
355 | check_assist( | 389 | check_assist( |
356 | fill_match_arms, | 390 | fill_match_arms, |