jinja : add count/d/e filter aliases (#24606)

This commit is contained in:
Sigbjørn Skjæret
2026-06-14 15:07:31 +02:00
committed by GitHub
parent 6e14286eda
commit acd79d603c
2 changed files with 18 additions and 10 deletions

View File

@@ -601,8 +601,8 @@ static void test_filters(testing & t) {
"hello jinja"
);
test_template(t, "length list",
"{{ items|length }}",
test_template(t, "length (count alias) list",
"{{ items|count }}",
{{"items", json::array({1, 2, 3})}},
"3"
);
@@ -711,8 +711,8 @@ static void test_filters(testing & t) {
"fallback"
);
test_template(t, "default with falsy value",
"{{ ''|default('fallback', true) }}",
test_template(t, "default (d alias) with falsy value",
"{{ ''|d('fallback', true) }}",
json::object(),
"fallback"
);