From 3641abc0c3e3ffaa1f6b5bf9b280b4217ea93e67 Mon Sep 17 00:00:00 2001 From: Domantas Jadenkus Date: Mon, 24 May 2021 22:01:26 +0300 Subject: [PATCH] add test that it does not create extraneous commas --- .../src/handlers/fill_match_arms.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/ide_assists/src/handlers/fill_match_arms.rs b/crates/ide_assists/src/handlers/fill_match_arms.rs index 711ef2393dc..3d2cd739aea 100644 --- a/crates/ide_assists/src/handlers/fill_match_arms.rs +++ b/crates/ide_assists/src/handlers/fill_match_arms.rs @@ -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!(), + } }"#, ); }