| 6 | #include <memory> |
| 7 | |
| 8 | TEST(RegexTest, matchesSimpleRegex) { |
| 9 | Regex exact("^cde$"); |
| 10 | |
| 11 | std::shared_ptr<RegexMatch> match(exact.find("cde")); |
| 12 | EXPECT_TRUE(match->matches()); |
| 13 | EXPECT_TRUE(match->getSubmatches().empty()); |
| 14 | |
| 15 | match = std::shared_ptr<RegexMatch>(exact.find("abcdefg")); |
| 16 | EXPECT_FALSE(match->matches()); |
| 17 | EXPECT_TRUE(match->getSubmatches().empty()); |
| 18 | } |
| 19 | |
| 20 | TEST(RegexTest, matchesRegexWithoutSubmatches) { |
| 21 | Regex variable("x\\d+x"); |