Tests
Test: dot-dot-operator
Template
{% for i in 5..10 %}{{ i }} {% endfor %}
Output Django v1.10.1
Output Jinja2 (error) v2.8.0
expected name or number
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks (error) v2.5.0
[Line 1, Column 14]
expected block end in for statement
Output Swig (error) v1.4.2
Unexpected number "5" on line 1.
Output Twig v1.24.2
5 6 7 8 9 10
Output Twigjs v0.9.5
5 6 7 8 9 10
Test: float-step
Template
{% for i in range(5, 10, 2.5) %}{{ i }} {% endfor %}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for i in range(5, 10, 2.5)
Output Jinja2 (error) v2.8.0
integer argument expected, got float
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
5 7.5
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
5 7.5 10
Output Twigjs v0.9.5
5 7.5 10
Test: negative-start
Template
{% for i in range(-5, 5) %}{{ i }} {% endfor %}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for i in range(-5, 5)
Output Jinja2 v2.8.0
-5 -4 -3 -2 -1 0 1 2 3 4
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
-5 -4 -3 -2 -1 0 1 2 3 4
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
-5 -4 -3 -2 -1 0 1 2 3 4 5
Output Twigjs v0.9.5
-5 -4 -3 -2 -1 0 1 2 3 4 5
Test: negative-step
Template
{% for i in range(10, 5, -1) %}{{ i }} {% endfor %}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for i in range(10, 5, -1)
Output Jinja2 v2.8.0
10 9 8 7 6
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
10 9 8 7 6
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
10 9 8 7 6 5
Output Twigjs (error) v0.9.5
(out of memory)
Test: start-stop-step
Template
{% for i in range(5, 10, 2) %}{{ i }} {% endfor %}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for i in range(5, 10, 2)
Output Jinja2 v2.8.0
5 7 9
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
5 7 9
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
5 7 9
Output Twigjs v0.9.5
5 7 9
Test: start-stop
Template
{% for i in range(5, 10) %}{{ i }} {% endfor %}
Output Django (error) v1.10.1
'for' statements should use the format 'for x in y': for i in range(5, 10)
Output Jinja2 v2.8.0
5 6 7 8 9
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
5 6 7 8 9
Output Swig (error) v1.4.2
(no output)
Output Twig v1.24.2
5 6 7 8 9 10
Output Twigjs v0.9.5
5 6 7 8 9 10
Test: stop
Template
{% for i in range(10) %}{{ i }} {% endfor %}
Output Django (error) v1.10.1
Could not parse the remainder: '(10)' from 'range(10)'
Output Jinja2 v2.8.0
0 1 2 3 4 5 6 7 8 9
Output Liquid (error) v3.0.6
(no output)
Output Nunjucks v2.5.0
0 1 2 3 4 5 6 7 8 9
Output Swig (error) v1.4.2
(no output)
Output Twig (error) v1.24.2
(no output)
Output Twigjs v0.9.5
10 9 8 7 6 5 4 3 2 1 0