From: Fariborz Jahanian Date: Thu, 20 Dec 2012 02:20:09 +0000 (+0000) Subject: Provide couple of DeclPrint tests for my last patch. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88d158c631c4c08831855f601990f36f2234f975;p=clang Provide couple of DeclPrint tests for my last patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170635 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/AST/DeclPrinterTest.cpp b/unittests/AST/DeclPrinterTest.cpp index 844b9a49e1..44fa74216b 100644 --- a/unittests/AST/DeclPrinterTest.cpp +++ b/unittests/AST/DeclPrinterTest.cpp @@ -1237,3 +1237,21 @@ TEST(DeclPrinter, TestObjCMethod1) { "- (int) A:(id)anObject inRange:(long)range")); } +TEST(DeclPrinter, TestObjCProtocol1) { + ASSERT_TRUE(PrintedDeclObjCMatches( + "@protocol P1, P2;", + namedDecl(hasName("P1")).bind("id"), + "@protocol P1;\n")); + ASSERT_TRUE(PrintedDeclObjCMatches( + "@protocol P1, P2;", + namedDecl(hasName("P2")).bind("id"), + "@protocol P2;\n")); +} + +TEST(DeclPrinter, TestObjCProtocol2) { + ASSERT_TRUE(PrintedDeclObjCMatches( + "@protocol P2 @end" + "@protocol P1 @end", + namedDecl(hasName("P1")).bind("id"), + "@protocol P1\n@end")); +}