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

Method snippetText

src/CukeCommands.cpp:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37const std::string CukeCommands::snippetText(
38 const std::string stepKeyword, const std::string stepName
39) const {
40 std::stringstream text;
41 std::string stepKeywordUpperCase;
42 std::transform(
43 stepKeyword.begin(), stepKeyword.end(), std::back_inserter(stepKeywordUpperCase), ::toupper
44 );
45 text << stepKeywordUpperCase << "(\"" << escapeCString("^" + escapeRegex(stepName) + "$")
46 << "\") {\n"
47 << " pending();\n"
48 << "}\n";
49 return text.str();
50}
51
52const std::string CukeCommands::escapeRegex(const std::string reg) const {
53 return regex_replace(

Callers 1

runMethod · 0.45

Calls 1

strMethod · 0.80

Tested by

no test coverage detected