diff options
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index dc2dc01e203..9c8efd882c4 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2212,14 +2212,11 @@ TEST_F(FormatTest, PutEmptyBlocksIntoOneLine) { // Line break tests. //===----------------------------------------------------------------------===// -TEST_F(FormatTest, FormatsAwesomeMethodCall) { +TEST_F(FormatTest, PreventConfusingIndents) { verifyFormat( "SomeLongMethodName(SomeReallyLongMethod(CallOtherReallyLongMethod(\n" " parameter, parameter, parameter)),\n" " SecondLongCall(parameter));"); -} - -TEST_F(FormatTest, PreventConfusingIndents) { verifyFormat( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n" " aaaaaaaaaaaaaaaaaaaaaaaa(\n" @@ -2724,6 +2721,12 @@ TEST_F(FormatTest, BreaksDesireably) { " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n" " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);"); + // Indent consistently indenpendent of call expression. + verifyFormat("aaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccc(\n" + " dddddddddddddddddddddddddddddd));\n" + "aaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(\n" + " dddddddddddddddddddddddddddddd));"); + // This test case breaks on an incorrect memoization, i.e. an optimization not // taking into account the StopAt value. verifyFormat( @@ -5259,7 +5262,7 @@ TEST_F(FormatTest, BreakStringLiterals) { getLLVMStyleWithColumns(20))); EXPECT_EQ( "f(\"one two\".split(\n" - " variable));", + " variable));", format("f(\"one two\".split(variable));", getLLVMStyleWithColumns(20))); EXPECT_EQ("f(\"one two three four five six \"\n" " \"seven\".split(\n" |