summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-02-10 02:08:05 +0000
committerNico Weber <nicolasweber@gmx.de>2013-02-10 02:08:05 +0000
commit2a726b6c34d4fa57a8ddc6e94525d531b684ae6f (patch)
tree85a14d5c283be8766529511f7fdb83340d9b5f1c /clang/unittests
parent234c00d6d02d2124fa3abe3db4172e9edb2787fd (diff)
downloadbcm5719-llvm-2a726b6c34d4fa57a8ddc6e94525d531b684ae6f.tar.gz
bcm5719-llvm-2a726b6c34d4fa57a8ddc6e94525d531b684ae6f.zip
Formatter: Detect ObjC array literals.
Use this to add a space after "@[" and before "]" for now. Later, I want to use this to format multi-line array literals nicer, too. llvm-svn: 174822
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 8d72df2754d..4e44f5e6509 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -2540,8 +2540,13 @@ TEST_F(FormatTest, ObjCLiterals) {
verifyFormat("NSNumber *favoriteColor = @(Green);");
verifyFormat("NSString *path = @(getenv(\"PATH\"));");
- // FIXME: Array and dictionary literals need more work.
verifyFormat("@[");
+ verifyFormat("@[]");
+ verifyFormat(
+ "NSArray *array = @[ @\" Hey \", NSApp, [NSNumber numberWithInt:42] ];");
+ verifyFormat("return @[ @3, @[], @[ @4, @5 ] ];");
+
+ // FIXME: Array and dictionary literals need more work.
verifyFormat("@{");
}
OpenPOWER on IntegriCloud