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.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 3044c69cd0..ca7ed62ed1 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -608,6 +608,41 @@ TEST_F(FormatTest, UnderstandsMultiLineComments) {
NoBinPacking);
}
+TEST_F(FormatTest, AlignsMultiLineComments) {
+ EXPECT_EQ("/*\n"
+ " * Really multi-line\n"
+ " * comment.\n"
+ " */\n"
+ "void f() {}",
+ format(" /*\n"
+ " * Really multi-line\n"
+ " * comment.\n"
+ " */\n"
+ " void f() {}"));
+ EXPECT_EQ("/*\n"
+ " A comment.\n"
+ " */\n"
+ "void f() {}",
+ format(" /*\n"
+ " A comment.\n"
+ " */\n"
+ " void f() {}"));
+ EXPECT_EQ("class C {\n"
+ " /*\n"
+ " * Another multi-line\n"
+ " * comment.\n"
+ " */\n"
+ " void f() {}\n"
+ "};",
+ format("class C {\n"
+ "/*\n"
+ " * Another multi-line\n"
+ " * comment.\n"
+ " */\n"
+ "void f() {}\n"
+ "};"));
+}
+
TEST_F(FormatTest, CommentsInStaticInitializers) {
EXPECT_EQ(
"static SomeType type = { aaaaaaaaaaaaaaaaaaaa, /* comment */\n"