aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 677b0e99bd..a16e449361 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -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