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

Method extractedParamsAre

tests/unit/StepManagerTest.cpp:44–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 }
43
44 bool extractedParamsAre(const string stepMatch, map<std::ptrdiff_t, string> params) {
45 MatchResult::match_results_type resultSet = getResultSetFor(stepMatch);
46 if (resultSet.size() != 1) {
47 return false; // more than one match
48 }
49 SingleStepMatch match = resultSet.front();
50 if (params.size() != match.submatches.size()) {
51 return false;
52 }
53 SingleStepMatch::submatches_type::const_iterator rsi;
54 for (rsi = match.submatches.begin(); rsi != match.submatches.end(); ++rsi) {
55 if (params.find(rsi->position) == params.end())
56 return false;
57 if (rsi->value != params[rsi->position]) {
58 return false;
59 }
60 }
61 return true;
62 }
63
64private:
65 MatchResult::match_results_type getResultSetFor(const string& stepMatch) {

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected