Add capitalize function (#282)

* Add capitalize function

* Remove msvc warning
This commit is contained in:
ascii
2024-09-19 15:03:33 +02:00
committed by GitHub
parent 0066e6049e
commit c360b19855
5 changed files with 23 additions and 1 deletions

View File

@@ -58,6 +58,11 @@ TEST_CASE("functions") {
// [json.exception.type_error.302] type must be string, but is number" );
}
SUBCASE("capitalize") {
CHECK(env.render("{{ capitalize(name) }}", data) == "Peter");
CHECK(env.render("{{ capitalize(city) }}", data) == "New york");
}
SUBCASE("range") {
CHECK(env.render("{{ range(2) }}", data) == "[0,1]");
CHECK(env.render("{{ range(4) }}", data) == "[0,1,2,3]");