summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-06 07:17:22 +0000
committerDaniel Jasper <djasper@google.com>2015-05-06 07:17:22 +0000
commit6d9b88dd997c3188446c6f63c852676bc0e6e432 (patch)
tree6884dabf90d6bd682d74d2c97f1768ab4ff15553 /clang/unittests/Format/FormatTest.cpp
parent26f165b04e803756b870f59fd5f1ab0cd89d0ae0 (diff)
downloadbcm5719-llvm-6d9b88dd997c3188446c6f63c852676bc0e6e432.tar.gz
bcm5719-llvm-6d9b88dd997c3188446c6f63c852676bc0e6e432.zip
clang-format: Fix bug in multiline comment wrapping.
Splitting: /** * multiline block comment * */ Before: /** * multiline block *comment * */ After: /** * multiline block * comment * */ The reason was that the empty line inside the comment (with just the "*") was confusing the comment breaking logic. llvm-svn: 236573
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index a1817ea1926..e5fe7b5091a 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1621,6 +1621,17 @@ TEST_F(FormatTest, SplitsLongLinesInComments) {
" */",
getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("/**\n"
+ " * multiline block\n"
+ " * comment\n"
+ " *\n"
+ " */",
+ format("/**\n"
+ " * multiline block comment\n"
+ " *\n"
+ " */",
+ getLLVMStyleWithColumns(20)));
+
EXPECT_EQ("/*\n"
"\n"
"\n"
@@ -6525,7 +6536,7 @@ TEST_F(FormatTest, BlockComments) {
EXPECT_EQ("/*\n"
"*\n"
" * aaaaaa\n"
- "*aaaaaa\n"
+ " * aaaaaa\n"
"*/",
format("/*\n"
"*\n"
OpenPOWER on IntegriCloud