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
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 7bae21b..f829dcc 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -8156,12 +8156,21 @@
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) {