Formatter: Add tests for some ObjC bits that happen to be formatted correctly.
llvm-svn: 171875
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 677b0e9..a16e449 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -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