diff --git a/test/test_main.cpp b/test/test_main.cpp index be0f2b6..a52fe3c 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -73,13 +73,16 @@ mstch::node parse_with_rapidjson(const std::string& str) { if (test.count("partials")) \ for (auto& partial_item: get(test["partials"])) \ partials.insert(std::make_pair(partial_item.first, get(partial_item.second))); \ + mstch::map context; \ for (auto& data_item: get(test["data"])) \ if (data_item.first == "lambda") \ - data_item.second = specs_lambdas[get(test["name"])]; \ + context.insert(std::make_pair(data_item.first, specs_lambdas[get(test["name"])])); \ + else \ + context.insert(data_item); \ SECTION(get(test["name"])) \ REQUIRE(mstch::render( \ get(test["template"]), \ - test["data"], partials) == \ + context, partials) == \ get(test["expected"])); \ } \ }