aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-03-01 13:14:08 +0000
committerManuel Klimek <klimek@google.com>2013-03-01 13:14:08 +0000
commitaf31fd7021e685280da9155e5017f1053b05fdf8 (patch)
tree7c34fe96e124f258328ec7bb35388045fee800e0 /unittests/Format/FormatTest.cpp
parent2fbe92cc2464c77825209df9a262d9d13e5ba64c (diff)
Implement fallback split point for string literals.
If we don't find a natural split point (currently space) in a string literal protruding over the line, we just split at the last possible point. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index baeb0143bc..8cc81684cb 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -3003,7 +3003,8 @@ TEST_F(FormatTest, BreakStringLiterals) {
EXPECT_EQ("\"some \"\n"
"\"text\"",
format("\"some text\"", getLLVMStyleWithColumns(7)));
- EXPECT_EQ("\"some text\"",
+ EXPECT_EQ("\"some\"\n"
+ "\" text\"",
format("\"some text\"", getLLVMStyleWithColumns(6)));
EXPECT_EQ("variable =\n"
@@ -3041,6 +3042,12 @@ TEST_F(FormatTest, BreakStringLiterals) {
"aaaaaaaaaaaaaaaaaaaa(\n"
" aaaaaaaaaaaaaaaaaaaa,\n"
" aaaaaa(\"aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa\"));");
+
+ EXPECT_EQ(
+ "\"splitmea\"\n"
+ "\"trandompo\"\n"
+ "\"int\"",
+ format("\"splitmeatrandompoint\"", getLLVMStyleWithColumns(10)));
}
} // end namespace tooling