aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index c9b255ce41..ba6d7519c6 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -404,6 +404,21 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
" // Comment inside a statement.\n"
" bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;");
+ EXPECT_EQ("void f() { // This does something ..\n"
+ "}\n"
+ "int a; // This is unrelated",
+ format("void f() { // This does something ..\n"
+ " }\n"
+ "int a; // This is unrelated"));
+ EXPECT_EQ("void f() { // This does something ..\n"
+ "} // awesome..\n"
+ "\n"
+ "int a; // This is unrelated",
+ format("void f() { // This does something ..\n"
+ " } // awesome..\n"
+ " \n"
+ "int a; // This is unrelated"));
+
EXPECT_EQ("int i; // single line trailing comment",
format("int i;\\\n// single line trailing comment"));