]> git.lizzy.rs Git - rust.git/commitdiff
add test that it does not create extraneous commas
authorDomantas Jadenkus <djadenkus@gmail.com>
Mon, 24 May 2021 19:01:26 +0000 (22:01 +0300)
committerDomantas Jadenkus <djadenkus@gmail.com>
Mon, 24 May 2021 19:17:16 +0000 (22:17 +0300)
crates/ide_assists/src/handlers/fill_match_arms.rs

index 711ef2393dc6c5f2c1ed48c4c6df1f6255ec0d97..3d2cd739aeaf0b1b197b0dda0903fc048351cfce 100644 (file)
@@ -1093,6 +1093,26 @@ fn foo(t: bool) {
         true => 1 + 2,
         $0false => todo!(),
     }
+}"#,
+        );
+    }
+
+    #[test]
+    fn does_not_add_extra_comma() {
+        check_assist(
+            fill_match_arms,
+            r#"
+fn foo(t: bool) {
+    match $0t {
+        true => 1 + 2,
+    }
+}"#,
+            r#"
+fn foo(t: bool) {
+    match t {
+        true => 1 + 2,
+        $0false => todo!(),
+    }
 }"#,
         );
     }