]> granicus.if.org Git - clang/commitdiff
Formatter: Add test for template and protocol parameters in ObjC method declarations.
authorNico Weber <nicolasweber@gmx.de>
Thu, 10 Jan 2013 20:18:33 +0000 (20:18 +0000)
committerNico Weber <nicolasweber@gmx.de>
Thu, 10 Jan 2013 20:18:33 +0000 (20:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172100 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index 9d29880722da2ccad6b4208f52a5304695a28157..5844853e05df522c8287993471b9c06f40109593 100644 (file)
@@ -1176,6 +1176,12 @@ TEST_F(FormatTest, FormatForObjectiveCMethodDecls) {
           "outRange4:(NSRange) out_range4  outRange5:(NSRange) out_range5 "
           "outRange6:(NSRange) out_range6  outRange7:(NSRange) out_range7  "
           "outRange8:(NSRange) out_range8  outRange9:(NSRange) out_range9;"));
+
+  verifyFormat("- (int)sum:(vector<int>)numbers;");
+  verifyGoogleFormat("- (void)setDelegate:(id<Protocol>)delegate;");
+  // FIXME: In LLVM style, there should be a space in front of a '<' for ObjC
+  // protocol lists (but not for template classes):
+  //verifyFormat("- (void)setDelegate:(id <Protocol>)delegate;");
 }
 
 TEST_F(FormatTest, FormatObjCBlocks) {