[cfe-commits] r170635 - /cfe/trunk/unittests/AST/DeclPrinterTest.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Dec 19 18:20:10 PST 2012
Author: fjahanian
Date: Wed Dec 19 20:20:09 2012
New Revision: 170635
URL: http://llvm.org/viewvc/llvm-project?rev=170635&view=rev
Log:
Provide couple of DeclPrint tests for my last patch.
Modified:
cfe/trunk/unittests/AST/DeclPrinterTest.cpp
Modified: cfe/trunk/unittests/AST/DeclPrinterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/DeclPrinterTest.cpp?rev=170635&r1=170634&r2=170635&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/DeclPrinterTest.cpp (original)
+++ cfe/trunk/unittests/AST/DeclPrinterTest.cpp Wed Dec 19 20:20:09 2012
@@ -1237,3 +1237,21 @@
"- (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<P2> @end",
+ namedDecl(hasName("P1")).bind("id"),
+ "@protocol P1<P2>\n at end"));
+}
More information about the cfe-commits
mailing list