mirror of
https://github.com/pantor/inja.git
synced 2026-10-17 01:08:19 +00:00
at function for objects
This commit is contained in:
1 parent
b473873853
commit
4e909475ea
3 files changed
+10
-1
No files matched your search
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user