Add additional test-case for one-line-function.

This ensures that we format:
void longFunctionName {
} // long comment here

And not:
void longFunctionName {}
// long comment here

As requested in post-commit-review.

llvm-svn: 182024
This commit is contained in:
Daniel Jasper 2013-05-16 16:54:34 +00:00
parent 47db66d43f
commit 9271650e61
1 changed files with 3 additions and 0 deletions

View File

@ -3066,6 +3066,9 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) {
"}");
verifyFormat("void f() {} // comment");
verifyFormat("void f() { int a; } // comment");
verifyFormat("void f() {\n"
"} // comment",
getLLVMStyleWithColumns(15));
verifyFormat("void f() { return 42; }", getLLVMStyleWithColumns(23));
verifyFormat("void f() {\n return 42;\n}", getLLVMStyleWithColumns(22));