mirror of
https://github.com/pantor/inja.git
synced 2026-03-01 06:46:24 +00:00
add join function (#204)
* add join function * fix formatting to match single include * add join test * add join to documentation * fix MSVC warning: signed/unsigned mismatch Co-authored-by: Wim Leflere <wleflere@cochlear.com>
This commit is contained in:
@@ -174,6 +174,11 @@ TEST_CASE("functions") {
|
||||
"[inja.exception.render_error] (at 1:22) variable 'sister' not found");
|
||||
}
|
||||
|
||||
SUBCASE("join") {
|
||||
CHECK(env.render("{{ join(names, \" | \") }}", data) == "Jeff | Seb | Peter | Tom");
|
||||
CHECK(env.render("{{ join(vars, \", \") }}", data) == "2, 3, 4, 0, -1, -2, -3");
|
||||
}
|
||||
|
||||
SUBCASE("isType") {
|
||||
CHECK(env.render("{{ isBoolean(is_happy) }}", data) == "true");
|
||||
CHECK(env.render("{{ isBoolean(vars) }}", data) == "false");
|
||||
|
||||
Reference in New Issue
Block a user