diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-28 09:35:24 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-28 09:35:24 +0000 |
commit | ae8699bde649e2ed1f66414b4283b862f11056dd (patch) | |
tree | 6a74b5be281b3834b7022104096d58c7234b050d /unittests/Format/FormatTest.cpp | |
parent | 5f2173ee723fd17b758f2a35a5bb39ca74eca523 (diff) |
Several small changes in formatting decisions.
1. Use a hanging ident for function calls nested in binary expressions.
E.g.:
int aaaaa = aaaaaaaaa && aaaaaaaaaa(
aaaaaaaaaa);
2. Slightly improve heuristic for builder type expressions and reduce
penalty for breaking before "." and "->" in those.
3. Remove mostly obsolete metric of decreasing indent level. This
fixes: llvm.org/PR14931.
Changes #1 and #2 were necessary to keep tests passing after #3.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index e47c7a5196..57252f547d 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -856,7 +856,7 @@ TEST_F(FormatTest, FormatsAwesomeMethodCall) { " SecondLongCall(parameter));"); } -TEST_F(FormatTest, HigherIndentsForDeeperNestedParameters) { +TEST_F(FormatTest, PreventConfusingIndents) { verifyFormat( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n" " aaaaaaaaaaaaaaaaaaaaaaaa(\n" @@ -872,6 +872,9 @@ TEST_F(FormatTest, HigherIndentsForDeeperNestedParameters) { " aaaaaaaaaaaaaaaaaaaaaaaa<\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>,\n" " aaaaaaaaaaaaaaaaaaaaaaaa>;"); + verifyFormat("int a = bbbb && ccc && fffff(\n" + "#define A Just forcing a new line\n" + " ddd);"); } TEST_F(FormatTest, ConstructorInitializers) { |