diff options
author | Nico Weber <nicolasweber@gmx.de> | 2013-01-09 21:15:03 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-01-09 21:15:03 +0000 |
commit | 1abe6ea5b8961a0fc14c2e0bdbd7451f643ca065 (patch) | |
tree | 9dce7b92a3f04afa006cd9f12e74274ce49eb60a /unittests/Format/FormatTest.cpp | |
parent | fa49c18071500d43c86a3c0029aecaea954a64ca (diff) |
Formatting: Add support for @protocol.
Pull pieces of the @interface code into reusable methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 4decf94c76..e06544a95f 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1249,6 +1249,21 @@ TEST_F(FormatTest, FormatObjCInterface) { "@end"); } +TEST_F(FormatTest, FormatObjCProtocol) { + verifyFormat("@protocol Foo\n" + "@property(weak) id delegate;\n" + "- (NSUInteger)numberOfThings;\n" + "@end"); + + // FIXME: In LLVM style, there should be a space before '<' for protocols. + verifyFormat("@protocol MyProtocol<NSObject>\n" + "- (NSUInteger)numberOfThings;\n" + "@end"); + + verifyFormat("@protocol Foo;\n" + "@protocol Bar;\n"); +} + TEST_F(FormatTest, ObjCAt) { verifyFormat("@autoreleasepool"); verifyFormat("@catch"); |