Add pipe syntax support for function calls like in Jinja2, resolves #294 (#296)

This commit is contained in:
Vladislav Nawrocki
2025-10-18 15:35:57 +03:00
committed by GitHub
parent b3d0e06a95
commit ea845eee91
6 changed files with 104 additions and 0 deletions

View File

@@ -154,6 +154,12 @@ Yeah!
data) == R""""(Yeah!
)"""");
}
SUBCASE("pipe syntax") {
CHECK(env.render("{{ brother.name | upper }}", data) == "CHRIS");
CHECK(env.render("{{ brother.name | upper | lower }}", data) == "chris");
CHECK(env.render("{{ [\"C\", \"A\", \"B\"] | sort | join(\",\") }}", data) == "A,B,C");
}
}
TEST_CASE("templates") {