]> granicus.if.org Git - clang/commitdiff
Add additional test-case for one-line-function.
authorDaniel Jasper <djasper@google.com>
Thu, 16 May 2013 16:54:34 +0000 (16:54 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 16 May 2013 16:54:34 +0000 (16:54 +0000)
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

unittests/Format/FormatTest.cpp

index 37e9ba8643dd2ae6e99e104dd026bd8f1d6fb289..841ac552a5523241ca1343c8df43d5e58422b040 100644 (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));