aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-02-07 00:19:29 +0000
committerNico Weber <nicolasweber@gmx.de>2013-02-07 00:19:29 +0000
commit712f5b3bef988e8d3dd38fdf2264e7cc1a3f6bf9 (patch)
tree1a2bea100d7af6e19999dec79169349ed86c69ee /unittests/Format/FormatTest.cpp
parent8bf778eb9c0afb0a4c63a97ce504f50759c08d5f (diff)
Formatter: Move ObjC literal tests to its own test case.
Slightly expand the boxed expressions test with a few more snippets from http://clang.llvm.org/docs/ObjectiveCLiterals.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 10742a2609..6924e45504 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -2478,19 +2478,6 @@ TEST_F(FormatTest, ObjCAt) {
verifyFormat("@throw");
verifyFormat("@try");
- verifyFormat("@\"String\"");
- verifyFormat("@1");
- verifyFormat("@+4.8");
- verifyFormat("@-4");
- verifyFormat("@1LL");
- verifyFormat("@.5");
- verifyFormat("@'c'");
- verifyFormat("@true");
- verifyFormat("NSNumber *smallestInt = @(-INT_MAX - 1);");
- // FIXME: Array and dictionary literals need more work.
- verifyFormat("@[");
- verifyFormat("@{");
-
EXPECT_EQ("@interface", format("@ interface"));
// The precise formatting of this doesn't matter, nobody writes code like
@@ -2523,5 +2510,26 @@ TEST_F(FormatTest, ObjCSnippets) {
verifyGoogleFormat("@property(assign, getter=isEditable) BOOL editable;");
}
+TEST_F(FormatTest, ObjCLiterals) {
+ verifyFormat("@\"String\"");
+ verifyFormat("@1");
+ verifyFormat("@+4.8");
+ verifyFormat("@-4");
+ verifyFormat("@1LL");
+ verifyFormat("@.5");
+ verifyFormat("@'c'");
+ verifyFormat("@true");
+
+ verifyFormat("NSNumber *smallestInt = @(-INT_MAX - 1);");
+ verifyFormat("NSNumber *piOverTwo = @(M_PI / 2);");
+ verifyFormat("NSNumber *favoriteColor = @(Green);");
+ verifyFormat("NSString *path = @(getenv(\"PATH\"));");
+
+ // FIXME: Array and dictionary literals need more work.
+ verifyFormat("@[");
+ verifyFormat("@{");
+
+}
+
} // end namespace tooling
} // end namespace clang