}
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)));
}
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"
// 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 {}",
}
TEST_F(FormatTest, ConfigurableFunctionDeclarationIndentAfterType) {
- verifyFormat("void\n"
+ verifyFormat("double\n"
"f();",
getLLVMStyleWithColumns(8));
}