From 9e5b6c3ced66cffa403d7ce4a85f093b38119121 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 16 May 2013 16:54:34 +0000 Subject: [PATCH] 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 --- unittests/Format/FormatTest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 37e9ba8643..841ac552a5 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -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)); -- 2.40.0