aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-14 09:19:04 +0000
committerDaniel Jasper <djasper@google.com>2013-02-14 09:19:04 +0000
commitc5cfa490a1fa4eb1a3a17803c6125b42abd73455 (patch)
treec351b422ff16b9dd9e88dbd0d03e0c125c21bb4d /unittests/Format/FormatTest.cpp
parent31672fb8c3fd3410725c9a4f293810ab69889020 (diff)
Get less confused by trailing comma in Google style.
The formatter can now format: void aaaaaaaaaaaaaaaaaa(int level, double *min_x, double *max_x, double *min_y, double *max_y, double *min_z, double *max_z, ) { } Although this is invalid code, it frequently happens during development and clang-format should be nicer :-). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index d5e3c24545..e99aad7a8c 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1817,6 +1817,17 @@ TEST_F(FormatTest, HandlesIncludeDirectives) {
// Error recovery tests.
//===----------------------------------------------------------------------===//
+TEST_F(FormatTest, IncompleteParameterLists) {
+ verifyGoogleFormat("void aaaaaaaaaaaaaaaaaa(int level,\n"
+ " double *min_x,\n"
+ " double *max_x,\n"
+ " double *min_y,\n"
+ " double *max_y,\n"
+ " double *min_z,\n"
+ " double *max_z, ) {\n"
+ "}");
+}
+
TEST_F(FormatTest, IncorrectCodeTrailingStuff) {
verifyFormat("void f() { return; }\n42");
verifyFormat("void f() {\n"