diff options
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 1c100c3b9b0..09e514e7cdb 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -7585,9 +7585,9 @@ TEST_F(FormatTest, ObjCArrayLiterals) { " index:(NSUInteger)index\n" " nonDigitAttributes:\n" " (NSDictionary *)noDigitAttributes;"); - verifyFormat( - "[someFunction someLooooooooooooongParameter:\n" - " @[ NSBundle.mainBundle.infoDictionary[@\"a\"] ]];"); + verifyFormat("[someFunction someLooooooooooooongParameter:@[\n" + " NSBundle.mainBundle.infoDictionary[@\"a\"]\n" + "]];"); } TEST_F(FormatTest, ReformatRegionAdjustsIndent) { diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index a06daac24ec..a536926c73c 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -239,6 +239,13 @@ TEST_F(FormatTestJS, FormatsFreestandingFunctions) { "}"); } +TEST_F(FormatTestJS, ArrayLiterals) { + verifyFormat("var aaaaa: List<SomeThing> = [\n" + " new SomeThingAAAAAAAAAAAA(),\n" + " new SomeThingBBBBBBBBB()\n" + "];"); +} + TEST_F(FormatTestJS, FunctionLiterals) { verifyFormat("doFoo(function() {});"); verifyFormat("doFoo(function() { return 1; });"); |