diff options
author | Daniel Jasper <djasper@google.com> | 2014-10-27 17:13:59 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-10-27 17:13:59 +0000 |
commit | e068ac77a223588faf7d80b36e516a656d9b52f6 (patch) | |
tree | dca3f80760afef6d7d22cf07f5ee6483364fdfa8 /clang/unittests/Format/FormatTest.cpp | |
parent | 1f060a85526ac08fd23b46968fd97f75a2930030 (diff) | |
download | bcm5719-llvm-e068ac77a223588faf7d80b36e516a656d9b52f6.tar.gz bcm5719-llvm-e068ac77a223588faf7d80b36e516a656d9b52f6.zip |
clang-format: Don't break after very short return types.
Before:
void
SomeFunction(int parameter);
After:
void SomeFunction(
int parameter);
(Unless AlwaysBreakAfterDefinitionReturnType after type is set).
llvm-svn: 220686
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index f29aff8f0e9..56163f70070 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -1207,8 +1207,8 @@ TEST_F(FormatTest, CorrectlyHandlesLengthOfBlockComments) { } TEST_F(FormatTest, DontBreakNonTrailingBlockComments) { - EXPECT_EQ("void\n" - "ffffffffff(int aaaaa /* test */);", + EXPECT_EQ("void ffffffffff(\n" + " int aaaaa /* test */);", format("void ffffffffff(int aaaaa /* test */);", getLLVMStyleWithColumns(35))); } @@ -1258,11 +1258,11 @@ TEST_F(FormatTest, SplitsLongCxxComments) { format("// A comment before a macro definition\n" "#define a b", getLLVMStyleWithColumns(20))); - EXPECT_EQ("void\n" - "ffffff(int aaaaaaaaa, // wwww\n" - " int bbbbbbbbbb, // xxxxxxx\n" - " // yyyyyyyyyy\n" - " int c, int d, int e) {}", + EXPECT_EQ("void ffffff(\n" + " int aaaaaaaaa, // wwww\n" + " int bbbbbbbbbb, // xxxxxxx\n" + " // yyyyyyyyyy\n" + " int c, int d, int e) {}", format("void ffffff(\n" " int aaaaaaaaa, // wwww\n" " int bbbbbbbbbb, // xxxxxxx yyyyyyyyyy\n" @@ -3538,8 +3538,8 @@ TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) { // they are not function-like. FormatStyle Style = getGoogleStyle(); Style.ColumnLimit = 47; - verifyFormat("void\n" - "someLongFunction(int someLongParameter) const {\n}", + verifyFormat("void someLongFunction(\n" + " int someLoooooooooooooongParameter) const {\n}", getLLVMStyleWithColumns(47)); verifyFormat("LoooooongReturnType\n" "someLoooooooongFunction() const {}", @@ -7400,7 +7400,7 @@ TEST_F(FormatTest, ConfigurableIndentWidth) { } TEST_F(FormatTest, ConfigurableFunctionDeclarationIndentAfterType) { - verifyFormat("void\n" + verifyFormat("double\n" "f();", getLLVMStyleWithColumns(8)); } |