mirror of
https://github.com/pantor/inja.git
synced 2026-03-01 14:56:26 +00:00
Fix issue 246 (#247)
* Add `parse_expression` with one argument in preparation to fix #246. * Fix issue #246: `func(n1 + n2, n3)` runs as if `func(n1, n2 + n3)` * Simplify parser for an expression enclosed by parentheses.
This commit is contained in:
@@ -264,6 +264,8 @@ TEST_CASE("callbacks") {
|
||||
CHECK(env.render("{{ double-greetings }}", data) == "Hello Hello!");
|
||||
CHECK(env.render("{{ double-greetings() }}", data) == "Hello Hello!");
|
||||
CHECK(env.render("{{ multiply(4, 5) }}", data) == "20.0");
|
||||
CHECK(env.render("{{ multiply(4, 2 + 3) }}", data) == "20.0");
|
||||
CHECK(env.render("{{ multiply(2 + 2, 5) }}", data) == "20.0");
|
||||
CHECK(env.render("{{ multiply(length(\"tester\"), 5) }}", data) == "30.0");
|
||||
CHECK(env.render("{{ multiply(5, length(\"t\")) }}", data) == "5.0");
|
||||
CHECK(env.render("{{ multiply(3, 4, 5) }}", data) == "60.0");
|
||||
|
||||
Reference in New Issue
Block a user