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 8b1f69a76e..052c852a63 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -537,6 +537,13 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { " aaaaaaaaaaaaaaaaaaaaaa); // 81 cols with this comment"); } +TEST_F(FormatTest, RemovesTrailingWhitespaceOfComments) { + EXPECT_EQ("// comment", format("// comment ")); + EXPECT_EQ("int aaaaaaa, bbbbbbb; // comment", + format("int aaaaaaa, bbbbbbb; // comment ", + getLLVMStyleWithColumns(33))); +} + TEST_F(FormatTest, UnderstandsMultiLineComments) { verifyFormat("f(/*test=*/ true);"); EXPECT_EQ( |