MCPcopy Create free account
hub / github.com/cucumber/cucumber-cpp / TEST

Function TEST

tests/unit/RegexTest.cpp:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <memory>
7
8TEST(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
20TEST(RegexTest, matchesRegexWithoutSubmatches) {
21 Regex variable("x\\d+x");

Callers

nothing calls this directly

Calls 3

findMethod · 0.80
findAllMethod · 0.80
matchesMethod · 0.45

Tested by

no test coverage detected