Adding tests since when I was asked whether this works I wasn't

100% sure.

llvm-svn: 169725
This commit is contained in:
Manuel Klimek 2012-12-10 07:08:53 +00:00
parent 6b819c5fb1
commit e792efd7ba
1 changed files with 7 additions and 0 deletions

View File

@ -80,6 +80,13 @@ TEST(NameableDeclaration, REMatchesVariousDecls) {
EXPECT_TRUE(matches("int aFOObBARc;", Abc));
EXPECT_TRUE(notMatches("int cab;", Abc));
EXPECT_TRUE(matches("int cabc;", Abc));
DeclarationMatcher StartsWithK = namedDecl(matchesName(":k[^:]*$"));
EXPECT_TRUE(matches("int k;", StartsWithK));
EXPECT_TRUE(matches("int kAbc;", StartsWithK));
EXPECT_TRUE(matches("namespace x { int kTest; }", StartsWithK));
EXPECT_TRUE(matches("class C { int k; };", StartsWithK));
EXPECT_TRUE(notMatches("class C { int ckc; };", StartsWithK));
}
TEST(DeclarationMatcher, MatchClass) {