Jinja Compat Tests

Enabled engines

reverse filter

Template

{% for item in items|reverse %}
{{ item }}
{% endfor %}

Data

{
  "items": [1, 2, 3, 4]
}

(error) v1.10.1

Invalid filter: 'reverse'

v2.8.0


4

3

2

1

v3.0.6


1

2

3

4

v2.5.0


4

3

2

1

v1.4.2


4

3

2

1

v1.24.2

4
3
2
1

v0.9.5

4
3
2
1

Template

{{ 1234|reverse }}

(error) v1.10.1

Invalid filter: 'reverse'

(error) v2.8.0

argument must be iterable

v3.0.6

1234

(error) v2.5.0

(no output)

v1.4.2

1234

v1.24.2

4321

(error) v0.9.5

(no output)

Template

{% for key, value in mapping|reverse %}
{{ key }}: {{ value }}
{% endfor %}

Data

{
  "mapping": { "1": "a", "2": "b", "3": "c" }
}

(error) v1.10.1

Invalid filter: 'reverse'

(error) v2.8.0

need more than 1 value to unpack

(error) v3.0.6

Liquid syntax error: Syntax Error in 'for loop' - Valid syntax: for [item] in [collection]

(error) v2.5.0

(no output)

v1.4.2


0: 3

1: 2

2: 1

v1.24.2

0: c
1: b
2: a

v0.9.5

3: c
2: b
1: a

Template

{% for key, value in mapping|reverse(true) %}
{{ key }}: {{ value }}
{% endfor %}

Data

{
  "mapping": { "1": "a", "2": "b", "3": "c" }
}

(error) v1.10.1

Invalid filter: 'reverse'

(error) v2.8.0

do_reverse() takes exactly 1 argument (2 given)

(error) v3.0.6

Liquid syntax error: Syntax Error in 'for loop' - Valid syntax: for [item] in [collection]

(error) v2.5.0

(no output)

v1.4.2


0: 3

1: 2

2: 1

v1.24.2

3: c
2: b
1: a

v0.9.5

3: c
2: b
1: a

Template

{{ '1234'|reverse }}

(error) v1.10.1

Invalid filter: 'reverse'

v2.8.0

4321

v3.0.6

1234

v2.5.0

4321

v1.4.2

4321

v1.24.2

4321

v0.9.5

4321