Skip to content
Snippets Groups Projects
Commit 9e5b6c3c authored by Daniel Jasper's avatar Daniel Jasper
Browse files

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182024 91177308-0d34-0410-b5e6-96231b3b80d8
parent 299cb286
No related branches found
No related tags found
No related merge requests found
...@@ -3066,6 +3066,9 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) { ...@@ -3066,6 +3066,9 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) {
"}"); "}");
verifyFormat("void f() {} // comment"); verifyFormat("void f() {} // comment");
verifyFormat("void f() { int a; } // comment"); verifyFormat("void f() { int a; } // comment");
verifyFormat("void f() {\n"
"} // comment",
getLLVMStyleWithColumns(15));
verifyFormat("void f() { return 42; }", getLLVMStyleWithColumns(23)); verifyFormat("void f() { return 42; }", getLLVMStyleWithColumns(23));
verifyFormat("void f() {\n return 42;\n}", getLLVMStyleWithColumns(22)); verifyFormat("void f() {\n return 42;\n}", getLLVMStyleWithColumns(22));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment