diff options
author | Domantas Jadenkus <[email protected]> | 2021-05-24 20:01:26 +0100 |
---|---|---|
committer | Domantas Jadenkus <[email protected]> | 2021-05-24 20:17:16 +0100 |
commit | 3641abc0c3e3ffaa1f6b5bf9b280b4217ea93e67 (patch) | |
tree | d0a8b7c8d3ff5b2dbb7ba12fa004c547296c14b7 /crates | |
parent | 8d2e3816bce0420c186e35d073b8e56ce0e38506 (diff) |
add test that it does not create extraneous commas
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ide_assists/src/handlers/fill_match_arms.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/fill_match_arms.rs b/crates/ide_assists/src/handlers/fill_match_arms.rs index 711ef2393..3d2cd739a 100644 --- a/crates/ide_assists/src/handlers/fill_match_arms.rs +++ b/crates/ide_assists/src/handlers/fill_match_arms.rs | |||
@@ -1096,4 +1096,24 @@ fn foo(t: bool) { | |||
1096 | }"#, | 1096 | }"#, |
1097 | ); | 1097 | ); |
1098 | } | 1098 | } |
1099 | |||
1100 | #[test] | ||
1101 | fn does_not_add_extra_comma() { | ||
1102 | check_assist( | ||
1103 | fill_match_arms, | ||
1104 | r#" | ||
1105 | fn foo(t: bool) { | ||
1106 | match $0t { | ||
1107 | true => 1 + 2, | ||
1108 | } | ||
1109 | }"#, | ||
1110 | r#" | ||
1111 | fn foo(t: bool) { | ||
1112 | match t { | ||
1113 | true => 1 + 2, | ||
1114 | $0false => todo!(), | ||
1115 | } | ||
1116 | }"#, | ||
1117 | ); | ||
1118 | } | ||
1099 | } | 1119 | } |