summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-20 16:45:46 +0000
committerDaniel Jasper <djasper@google.com>2013-10-20 16:45:46 +0000
commitd489dd342bfdc2481a62633c8f8d66d6e2339dcb (patch)
tree6db628a8ba69d9886b9f51ef1f05675aadd8b249 /clang/unittests/Format/FormatTest.cpp
parent80b5a9d2d094724db1da43c80739b2042975a2eb (diff)
downloadbcm5719-llvm-d489dd342bfdc2481a62633c8f8d66d6e2339dcb.tar.gz
bcm5719-llvm-d489dd342bfdc2481a62633c8f8d66d6e2339dcb.zip
clang-format: Improve formatting of ObjC dict literals.
Before: NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; After: NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; llvm-svn: 193049
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 23a2203b015..dcb708e0d78 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5363,14 +5363,17 @@ TEST_F(FormatTest, ObjCLiterals) {
verifyFormat(
"NSDictionary *settings = @{ AVEncoderKey : @(AVAudioQualityMax) };");
- // FIXME: Nested and multi-line array and dictionary literals need more work.
verifyFormat(
- "NSDictionary *d = @{ @\"nam\" : NSUserNam(), @\"dte\" : [NSDate date],\n"
- " @\"processInfo\" : [NSProcessInfo processInfo] };");
+ "NSDictionary *d = @{\n"
+ " @\"nam\" : NSUserNam(),\n"
+ " @\"dte\" : [NSDate date],\n"
+ " @\"processInfo\" : [NSProcessInfo processInfo]\n"
+ "};");
verifyFormat(
- "@{ NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :\n"
- " regularFont, };");
-
+ "@{\n"
+ " NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee : "
+ "regularFont,\n"
+ "};");
}
TEST_F(FormatTest, ReformatRegionAdjustsIndent) {
OpenPOWER on IntegriCloud