aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unittests/AST/DeclPrinterTest.cpp18
1 files changed, 18 insertions, 0 deletions
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<P2> @end",
+ namedDecl(hasName("P1")).bind("id"),
+ "@protocol P1<P2>\n@end"));
+}