diff options
author | Manuel Klimek <klimek@google.com> | 2012-12-10 07:08:53 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2012-12-10 07:08:53 +0000 |
commit | ec33b6f64480df41a6add1f112c7321ba96de378 (patch) | |
tree | b81c3e4c8d1ff49a1d956c39015c263874a46dac /unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | 29573b0a825b888c233d7859a257e866ffc5276e (diff) |
Adding tests since when I was asked whether this works I wasn't
100% sure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 8beff0f98a..4fad5446ae 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -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) { |