summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-04-09 09:53:23 +0000
committerDaniel Jasper <djasper@google.com>2014-04-09 09:53:23 +0000
commitb175d57edc028888f958ee3cca7072f16db25fa5 (patch)
tree4afea50578aa2961210f84840609bd661f3fd96f /clang/unittests/Format/FormatTest.cpp
parentdfacecbd314f64bda5486e8f98624c15e203a23a (diff)
downloadbcm5719-llvm-b175d57edc028888f958ee3cca7072f16db25fa5.tar.gz
bcm5719-llvm-b175d57edc028888f958ee3cca7072f16db25fa5.zip
clang-format: Recognize lists ending in trailing commas correctly.
Previously, this did not look through trailing comments leading to a few formatting oddities. llvm-svn: 205843
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 975f9c6939b..5adc0d5725b 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5129,13 +5129,14 @@ TEST_F(FormatTest, FormatsBracedListsInColumnLayout) {
" 1, 1, 1, 1, 1, 1, 1, 1,\n"
"};",
getLLVMStyleWithColumns(39));
- verifyFormat("vector<int> x = {1, 1, 1, 1,\n"
- " 1, 1, 1, 1, //\n"
+ verifyFormat("vector<int> x = {\n"
+ " 1, 1, 1, 1, 1, 1, 1, 1, //\n"
"};",
getLLVMStyleWithColumns(39));
- verifyFormat("vector<int> x = {1, 1, 1, 1,\n"
- " 1, 1, 1, 1,\n"
- " /**/ /**/};",
+ verifyFormat("vector<int> x = {\n"
+ " 1, 1, 1, 1, 1, 1, 1, 1,\n"
+ " /**/ /**/\n"
+ "};",
getLLVMStyleWithColumns(39));
verifyFormat("return {{aaaaaaaaaaaaaaaaaaaaa},\n"
" {aaaaaaaaaaaaaaaaaaa},\n"
OpenPOWER on IntegriCloud