diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-02-10 02:08:05 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-02-10 02:08:05 +0000 |
commit | 051860ee770bf83c3e66ab893be3642bb8bc2680 (patch) | |
tree | 2983318f8dce4847e03526d728f6eeff593d12a4 /unittests/Format/FormatTest.cpp | |
parent | b7b25659355d736a4f19099d96acc54d672340a5 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 8d72df2754..4e44f5e650 100644 --- a/unittests/Format/FormatTest.cpp +++ b/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("@{"); } |