at function for objects

This commit is contained in:
pantor
2021-06-09 22:26:07 +02:00
parent b473873853
commit 4e909475ea
3 changed files with 10 additions and 1 deletions

View File

@@ -70,6 +70,8 @@ TEST_CASE("functions") {
SUBCASE("at") {
CHECK(env.render("{{ at(names, 0) }}", data) == "Jeff");
CHECK(env.render("{{ at(names, i) }}", data) == "Seb");
CHECK(env.render("{{ at(brother, \"name\") }}", data) == "Chris");
CHECK(env.render("{{ at(at(brother, \"daughters\"), 0) }}", data) == "Maria");
// CHECK(env.render("{{ at(names, 45) }}", data) == "Jeff");
}