diff options
author | Toby Dimmick <[email protected]> | 2020-06-14 22:43:16 +0100 |
---|---|---|
committer | Toby Dimmick <[email protected]> | 2020-06-14 22:43:16 +0100 |
commit | 34db4edb80ac614f5ca8d4e7bea4b6917368d6d6 (patch) | |
tree | fcd91e29f6a0d6b49b27725f27944e89c3db3ab8 /crates/ra_assists/src/handlers | |
parent | 017331a53c1eeaa1253d2829165627bfa27dc124 (diff) |
fill_match_arms bind pattern test
Diffstat (limited to 'crates/ra_assists/src/handlers')
-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, |