diff options
| author | Daniel Jasper <djasper@google.com> | 2014-04-14 12:11:07 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-04-14 12:11:07 +0000 |
| commit | db8804b32b17593e808173abe52f747a8d78ad8d (patch) | |
| tree | c474dccbce7e932cf0db6f56570cf97485074880 /clang/unittests/Format/FormatTest.cpp | |
| parent | af4fee2636b304ed86e8d05d8f076219d595b54c (diff) | |
| download | bcm5719-llvm-db8804b32b17593e808173abe52f747a8d78ad8d.tar.gz bcm5719-llvm-db8804b32b17593e808173abe52f747a8d78ad8d.zip | |
clang-format: Improve array literal formatting fix in r206161.
Instead of choosing based on the number of elements, simply respect the
user's choice of where to wrap array literals.
llvm-svn: 206162
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 7bae21b89e6..f829dccbe98 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -8156,12 +8156,21 @@ TEST_F(FormatTest, FormatsWithWebKitStyle) { verifyFormat("NSArray* a = [[NSArray alloc] initWithArray:@[ @\"a\" ]\n" " copyItems:YES];", Style); - verifyFormat("NSArray* a = [[NSArray alloc] initWithArray:@[\n" - " @\"a\",\n" - " @\"a\"\n" - " ]\n" - " copyItems:YES];", - Style); + EXPECT_EQ("NSArray* a = [[NSArray alloc] initWithArray:@[\n" + " @\"a\",\n" + " @\"a\"\n" + " ]\n" + " copyItems:YES];", + format("NSArray* a = [[NSArray alloc] initWithArray:@[\n" + " @\"a\",\n" + " @\"a\"\n" + " ]\n" + " copyItems:YES];", + Style)); + verifyFormat( + "NSArray* a = [[NSArray alloc] initWithArray:@[ @\"a\", @\"a\" ]\n" + " copyItems:YES];", + Style); } TEST_F(FormatTest, FormatsLambdas) { |

