From bcb2ea912bf96f38505c67a0b6896c6a5ac278ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Kohlgr=C3=BCber?= Date: Wed, 20 Nov 2019 19:01:06 +0100 Subject: fix 2190; add test for "replace if let with match" --- crates/ra_ide_api/src/join_lines.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/join_lines.rs b/crates/ra_ide_api/src/join_lines.rs index 6f71b27db..7deeb3494 100644 --- a/crates/ra_ide_api/src/join_lines.rs +++ b/crates/ra_ide_api/src/join_lines.rs @@ -243,6 +243,34 @@ fn foo(e: Result) { ); } + #[test] + fn join_lines_multiline_in_block() { + check_join_lines( + r" +fn foo() { + match ty { + <|> Some(ty) => { + match ty { + _ => false, + } + } + _ => true, + } +} +", + r" +fn foo() { + match ty { + <|> Some(ty) => match ty { + _ => false, + }, + _ => true, + } +} +", + ); + } + #[test] fn join_lines_keeps_comma_for_block_in_match_arm() { // We already have a comma -- cgit v1.2.3