add check for too few arguments in operator parser

This commit is contained in:
pantor
2022-07-10 13:46:33 +02:00
parent 72f90122a2
commit 9f923b3677
4 changed files with 12 additions and 3 deletions

View File

@@ -35,7 +35,8 @@ TEST_CASE("functions") {
CHECK(env.render("{{ 5^3 }}", data) == "125");
CHECK(env.render("{{ 5 + 12 + 4 * (4 - (1 + 1))^2 - 75 * 1 }}", data) == "-42");
// CHECK_THROWS_WITH(env.render("{{ +1 }}", data), "[inja.exception.render_error] (at 1:4) empty expression");
CHECK_THROWS_WITH(env.render("{{ +1 }}", data), "[inja.exception.parser_error] (at 1:7) too few arguments");
CHECK_THROWS_WITH(env.render("{{ 1 + }}", data), "[inja.exception.parser_error] (at 1:8) too few arguments");
}
SUBCASE("upper") {