mstch/test/specs_lambdas.hpp
2015-05-04 16:25:25 +02:00

26 lines
841 B
C++

std::map<std::string,std::function<std::string(const std::string&)>> specs_lambdas {
{"Interpolation", [](const std::string&) {
return "world";
}},
{"Interpolation - Expansion", [](const std::string&) {
return "{{planet}}";
}},
{"Interpolation - Multiple Calls", [](const std::string&) {
static int calls = 0; return std::to_string(++calls);
}},
{"Escaping", [](const std::string&) {
return ">";
}},
{"Section", [](const std::string& txt) {
return (txt == "{{x}}") ? "yes" : "no";
}},
{"Section - Expansion", [](const std::string& txt) {
return txt + "{{planet}}" + txt;
}},
{"Section - Multiple Calls", [](const std::string& txt) {
return "__" + txt + "__";
}},
{"Inverted Section", [](const std::string& txt) {
return "";
}}
};