introduce INJA_DATA_TYPE

This commit is contained in:
pantor
2021-09-06 09:15:48 +02:00
parent 12a2c9bbf2
commit 9b9dd96a46
8 changed files with 26 additions and 21 deletions

View File

@@ -36,16 +36,16 @@ TEST_CASE("copy environment") {
env.include_template("tpl", t1);
std::string test_tpl = "{% include \"tpl\" %}";
REQUIRE(env.render(test_tpl, json()) == "4");
REQUIRE(env.render(test_tpl, inja::json()) == "4");
inja::Environment copy(env);
CHECK(copy.render(test_tpl, json()) == "4");
CHECK(copy.render(test_tpl, inja::json()) == "4");
// overwrite template in source env
inja::Template t2 = env.parse("{{ double(4) }}");
env.include_template("tpl", t2);
REQUIRE(env.render(test_tpl, json()) == "8");
REQUIRE(env.render(test_tpl, inja::json()) == "8");
// template is unchanged in copy
CHECK(copy.render(test_tpl, json()) == "4");
CHECK(copy.render(test_tpl, inja::json()) == "4");
}