Skip to content

Commit

Permalink
Move render check to variables subcase
Browse files Browse the repository at this point in the history
  • Loading branch information
2x2anthony committed Oct 21, 2023
1 parent d1972eb commit 746bd2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test-renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ TEST_CASE("types") {
CHECK(env.render("{{ \"{{ no_value }}\" }}", data) == "{{ no_value }}");
CHECK(env.render("{{ @name }}", data) == "@name");
CHECK(env.render("{{ $name }}", data) == "$name");
CHECK(env.render("{{max_value}}", data) == "18446744073709551615");

CHECK_THROWS_WITH(env.render("{{unknown}}", data), "[inja.exception.render_error] (at 1:3) variable 'unknown' not found");
}
Expand All @@ -56,7 +57,6 @@ TEST_CASE("types") {
"false %}, {% endif %}{% endfor %}",
data) == "1: brother: Chris, 2: mother: Maria, 3: sister: Jenny");
CHECK(env.render("{% for v in vars %}{% if v > 0 %}+{% endif %}{% endfor %}", data) == "+++");
CHECK(env.render("{{max_value}}", data) == "18446744073709551615");
CHECK(env.render("{% for name in names %}{{ loop.index }}: {{ name }}{% if not loop.is_last %}, {% endif %}{% endfor %}!", data) == "0: Jeff, 1: Seb!");
CHECK(env.render("{% for name in names %}{{ loop.index }}: {{ name }}{% if loop.is_last == false %}, {% endif %}{% "
"endfor %}!",
Expand Down

0 comments on commit 746bd2b

Please sign in to comment.