diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-07 07:13:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-07 07:13:20 +0000 |
commit | 46a46a20a3ec397192550915964cb227e87b79b2 (patch) | |
tree | 21b08fc17ae39cab0f960d529d3b1a5cb3467580 /unittests/Format/FormatTest.cpp | |
parent | 0028ee3dd32c5e3b089c0ef176b97ebcdd2c4cf6 (diff) |
Put a higher penalty on breaking before "." or "->".
This fixes llvm.org/PR14823.
Before:
local_state->SetString(prefs::kApplicationLocale, parent_local_state
->GetString(prefs::kApplicationLocale));
After:
local_state->SetString(
prefs::kApplicationLocale,
parent_local_state->GetString(prefs::kApplicationLocale));
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 28f63aa055..de794dabb6 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -713,9 +713,14 @@ TEST_F(FormatTest, WrapsAtFunctionCallsIfNecessary) { "function(LoooooooooooooooooooooooooooooooooooongObject\n" " ->loooooooooooooooooooooooooooooooooooooooongFunction());"); + // Here, it is not necessary to wrap at "." or "->". verifyFormat("if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaa) ||\n" " aaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {\n" "}"); + verifyFormat( + "aaaaaaaaaaa->aaaaaaaaa(\n" + " aaaaaaaaaaaaaaaaaaaaaaaaa,\n" + " aaaaaaaaaaaaaaaaaa->aaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa));\n"); } TEST_F(FormatTest, WrapsTemplateDeclarations) { |