]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Added a test for #278
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 3 Jan 2017 01:29:12 +0000 (02:29 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 3 Jan 2017 22:45:30 +0000 (23:45 +0100)
tests/test_regression.py

index a5569a23254b237fef1a9e111ae7734132e60001..1ba936b8556f0613c11530af4146fe69ad018265 100644 (file)
@@ -297,3 +297,12 @@ class TestBug():
                                '{% for i in range(3) %}{{ i }}{% endfor %}'
                                '{% endfor %}')
         assert tmpl.render() == '012'
+
+    def test_macro_var_bug(self, env):
+        tmpl = env.from_string('''
+        {% set i = 1 %}
+        {% macro test() %}
+            {% for i in range(0, 10) %}{{ i }}{% endfor %}
+        {% endmacro %}{{ test() }}
+        ''')
+        assert tmpl.render().strip() == '0123456789'