aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-26 12:52:34 +0000
committerDaniel Jasper <djasper@google.com>2013-02-26 12:52:34 +0000
commit0fb382bfbfbfee73763a213b2257042ed342c4b0 (patch)
treee4b1fce3e2fb59728f8440eec3b3f6aa68a928bd /unittests/Format/FormatTest.cpp
parent863fb3574468ef9fdc9f5ea3fa3d62671979ccf1 (diff)
Only break string literals as a last resort.
We might want to move towards doing this if the formatting can be significantly improved, but we need to carefully evaluate the different situations first. Before (the string literal was split by clang-format here): aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa " "aaaaa aaa aaa aaaaaa")); After: aaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa")); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 17dae0ffe6..a902466c4c 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2984,6 +2984,12 @@ TEST_F(FormatTest, BreakStringLiterals) {
" \"text\",\n"
" other);",
format("f(\"some text\", other);", getLLVMStyleWithColumns(10)));
+
+ // Only break as a last resort.
+ verifyFormat(
+ "aaaaaaaaaaaaaaaaaaaa(\n"
+ " aaaaaaaaaaaaaaaaaaaa,\n"
+ " aaaaaa(\"aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa\"));");
}
} // end namespace tooling