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 | c7345ccc2c4732603d2803d10b2b235807727057 (patch) | |
| tree | 66392c6c123dc285aa01102af8ade4d6c818ef5a /clang/unittests/Format/FormatTest.cpp | |
| parent | 28c6594c71f5796cc2d1d4591f86bb5316de3aaf (diff) | |
| download | bcm5719-llvm-c7345ccc2c4732603d2803d10b2b235807727057.tar.gz bcm5719-llvm-c7345ccc2c4732603d2803d10b2b235807727057.zip | |
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));
llvm-svn: 171705
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 28f63aa0551..de794dabb6c 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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) { |

