jinja : add count/d/e filter aliases (#24606)
This commit is contained in:
@@ -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"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user