diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index eafc4c8512..1e92592488 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -194,6 +194,13 @@ TEST_F(FormatTest, FormatsCorrectRegionForLeadingWhitespace) { 25, 0, getLLVMStyleWithColumns(12))); } +TEST_F(FormatTest, RemovesWhitespaceWhenTriggeredOnEmptyLine) { + EXPECT_EQ("int a;\n\n int b;", + format("int a;\n \n\n int b;", 7, 0, getLLVMStyle())); + EXPECT_EQ("int a;\n\n int b;", + format("int a;\n \n\n int b;", 9, 0, getLLVMStyle())); +} + TEST_F(FormatTest, ReformatsMovedLines) { EXPECT_EQ( "template <typename T> T *getFETokenInfo() const {\n" |