summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-06-09 13:16:54 +0000
committerDaniel Jasper <djasper@google.com>2015-06-09 13:16:54 +0000
commitdee894f6bb0b6a16b00d834b40946e8592c2b54e (patch)
treec461158df4c792231075baf62b1ab1654c2a5f0d /clang/unittests/Format/FormatTest.cpp
parent6b62b659cbcd51e6dcedd5cf0e8501e74ffd9852 (diff)
downloadbcm5719-llvm-dee894f6bb0b6a16b00d834b40946e8592c2b54e.tar.gz
bcm5719-llvm-dee894f6bb0b6a16b00d834b40946e8592c2b54e.zip
clang-format: Support //!-comments, increase test coverage.
llvm-svn: 239404
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 0760530672b..c4aa712ba1d 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1337,6 +1337,16 @@ TEST_F(FormatTest, SplitsLongCxxComments) {
"// one line",
format("// A comment that doesn't fit on one line",
getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("/// A comment that\n"
+ "/// doesn't fit on\n"
+ "/// one line",
+ format("/// A comment that doesn't fit on one line",
+ getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("//! A comment that\n"
+ "//! doesn't fit on\n"
+ "//! one line",
+ format("//! A comment that doesn't fit on one line",
+ getLLVMStyleWithColumns(20)));
EXPECT_EQ("// a b c d\n"
"// e f g\n"
"// h i j k",
@@ -1357,6 +1367,12 @@ TEST_F(FormatTest, SplitsLongCxxComments) {
EXPECT_EQ("// Add leading\n"
"// whitespace",
format("//Add leading whitespace", getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("/// Add leading\n"
+ "/// whitespace",
+ format("///Add leading whitespace", getLLVMStyleWithColumns(20)));
+ EXPECT_EQ("//! Add leading\n"
+ "//! whitespace",
+ format("//!Add leading whitespace", getLLVMStyleWithColumns(20)));
EXPECT_EQ("// whitespace", format("//whitespace", getLLVMStyle()));
EXPECT_EQ("// Even if it makes the line exceed the column\n"
"// limit",
OpenPOWER on IntegriCloud