diff options
author | Daniel Jasper <djasper@google.com> | 2013-10-08 05:11:18 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-10-08 05:11:18 +0000 |
commit | ec01cd6e7fbb6f24844514cb1c83d7dea93672b8 (patch) | |
tree | b571ba569c95e3a32ceac557747a4279e598d89d /clang/unittests/Format/FormatTest.cpp | |
parent | 53f31af7ea0d4460e299055ffbd1daba650ce136 (diff) | |
download | bcm5719-llvm-ec01cd6e7fbb6f24844514cb1c83d7dea93672b8.tar.gz bcm5719-llvm-ec01cd6e7fbb6f24844514cb1c83d7dea93672b8.zip |
clang-format: Improve constructor initializer linewrapping.
Specifically make ConstructorInitializerAllOnOneLineOrOnePerLine work
nicely with BreakConstructorInitializersBeforeComma.
This fixes llvm.org/PR17395.
llvm-svn: 192168
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 6bb38e92f87..1916076ca08 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -6587,6 +6587,20 @@ TEST_F(FormatTest, ConstructorInitializerIndentWidth) { ", b(b)\n" ", c(c) {}", Style); + + Style.ConstructorInitializerAllOnOneLineOrOnePerLine = true; + Style.ConstructorInitializerIndentWidth = 4; + verifyFormat( + "SomeClass::Constructor()\n" + " : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa) {}", + Style); + Style.ConstructorInitializerIndentWidth = 4; + Style.ColumnLimit = 60; + verifyFormat("SomeClass::Constructor()\n" + " : aaaaaaaa(aaaaaaaa)\n" + " , aaaaaaaa(aaaaaaaa)\n" + " , aaaaaaaa(aaaaaaaa) {}", + Style); } TEST_F(FormatTest, FormatsWithWebKitStyle) { |