diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2013-01-08 17:56:31 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2013-01-08 17:56:31 +0000 |
| commit | 7e6a7a19e358e2a3361db45a0bedf3ca4e9a0291 (patch) | |
| tree | c205683be249135642ca31dfa874f960f8fa1f4e | |
| parent | 9f20781bad2d6f6af5000ca6ea9cd86a7e4da363 (diff) | |
| download | bcm5719-llvm-7e6a7a19e358e2a3361db45a0bedf3ca4e9a0291.tar.gz bcm5719-llvm-7e6a7a19e358e2a3361db45a0bedf3ca4e9a0291.zip | |
Formatter: Add tests for some ObjC bits that happen to be formatted correctly.
llvm-svn: 171875
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 677b0e99bda..a16e4493615 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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 |

