[cfe-commits] r171875 - /cfe/trunk/unittests/Format/FormatTest.cpp

Nico Weber nicolasweber at gmx.de
Tue Jan 8 09:56:31 PST 2013


Author: nico
Date: Tue Jan  8 11:56:31 2013
New Revision: 171875

URL: http://llvm.org/viewvc/llvm-project?rev=171875&view=rev
Log:
Formatter: Add tests for some ObjC bits that happen to be formatted correctly.

Modified:
    cfe/trunk/unittests/Format/FormatTest.cpp

Modified: cfe/trunk/unittests/Format/FormatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=171875&r1=171874&r2=171875&view=diff
==============================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp (original)
+++ cfe/trunk/unittests/Format/FormatTest.cpp Tue Jan  8 11:56:31 2013
@@ -1071,6 +1071,10 @@
 
 }
 
+//===----------------------------------------------------------------------===//
+// 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 @@
   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





More information about the cfe-commits mailing list