Add capitalize function (#282)

* Add capitalize function

* Remove msvc warning
This commit is contained in:
ascii authored and GitHub committed 2024-09-19 06:03:33 -07:00
1 parent 0066e6049e
commit c360b19855
5 files changed
+23 -1

No files matched your search

+5
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]");