]> granicus.if.org Git - clang/commitdiff
Formatter: Add tests for some ObjC bits that happen to be formatted correctly.
authorNico Weber <nicolasweber@gmx.de>
Tue, 8 Jan 2013 17:56:31 +0000 (17:56 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 8 Jan 2013 17:56:31 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171875 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index 677b0e99bda0e64b383123bce3c53afa8c4fefe8..a16e4493615bdbfb1bf8bf78039fdc2ab7e3a340 100644 (file)
@@ -1071,6 +1071,10 @@ TEST_F(FormatTest, IncorrectCodeErrorDetection) {
 
 }
 
+//===----------------------------------------------------------------------===//
+// Objective-C tests.
+//===----------------------------------------------------------------------===//
+
 TEST_F(FormatTest, FormatForObjectiveCMethodDecls) {
   verifyFormat("- (void)sendAction:(SEL)aSelector to:(BOOL)anObject;");
   EXPECT_EQ("- (NSUInteger)indexOfObject:(id)anObject;",
@@ -1140,5 +1144,14 @@ TEST_F(FormatTest, ObjCAt) {
   verifyFormat("@ /*foo*/ interface");
 }
 
+TEST_F(FormatTest, ObjCOneLiners) {
+  verifyFormat("@class Foo, Bar;");
+  verifyFormat("@synthesize dropArrowPosition = dropArrowPosition_;");
+  verifyFormat("@dynamic textColor;");
+
+  // FIXME: "getter=bar" should not be surround by spaces in @property.
+  verifyFormat("@property(assign, nonatomic) CGFloat hoverAlpha;");
+}
+
 } // end namespace tooling
 } // end namespace clang