diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-20 19:54:13 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-12-20 19:54:13 +0000 |
commit | 154120cde4f56ed04261bab302fdbbed1a7f080b (patch) | |
tree | 52ef97dca08e390c8bb4574e655d145146f7b502 /unittests/Format/FormatTest.cpp | |
parent | bbf4d53343c2bbd082b7c1488f34650a7d07ae3b (diff) |
Add objective-C style formatting to clang format and
use it to format xml declaration tags.
// rdar://12378714
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index c9cd825277..53253f0c79 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -667,5 +667,24 @@ TEST_F(FormatTest, IncorrectCodeErrorDetection) { } +TEST_F(FormatTest, FormatForObjectiveCMethodDecls) { + verifyFormat("- (void)sendAction:(SEL)aSelector to:(BOOL)anObject;"); + EXPECT_EQ("- (NSUInteger)indexOfObject:(id)anObject;", + format("-(NSUInteger)indexOfObject:(id)anObject;")); + EXPECT_EQ("- (NSInteger)Mthod1;", + format("-(NSInteger)Mthod1;")); + EXPECT_EQ("+ (id)Mthod2;", format("+(id)Mthod2;")); + EXPECT_EQ("- (NSInteger)Method3:(id)anObject;", + format("-(NSInteger)Method3:(id)anObject;")); + EXPECT_EQ("- (NSInteger)Method4:(id)anObject;", + format("-(NSInteger)Method4:(id)anObject;")); + EXPECT_EQ("- (NSInteger)Method5:(id)anObject:(id)AnotherObject;", + format("-(NSInteger)Method5:(id)anObject:(id)AnotherObject;")); + EXPECT_EQ("- (id)Method6:(id)A:(id)B:(id)C:(id)D;", + format("- (id)Method6:(id)A:(id)B:(id)C:(id)D;")); + EXPECT_EQ("- (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag;", + format("- (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag;")); +} + } // end namespace tooling } // end namespace clang |