From ca124c5cfe69ea695ac4caa05d0acb611de52adf Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 24 Jan 2017 20:16:02 +0100 Subject: Correctly use buffer for else frame in loops. Fixes #669 --- tests/test_regression.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/test_regression.py b/tests/test_regression.py index e6a2f0c..f2314de 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -520,3 +520,9 @@ class TestBug(object): assert x.resolve_or_missing('foo') == 42 assert x.resolve_or_missing('bar') == 23 assert x.resolve_or_missing('baz') is missing + + def test_recursive_loop_bug(self, env): + tmpl = env.from_string(''' + {%- for value in values recursive %}1{% else %}0{% endfor -%} + ''') + assert tmpl.render(values=[]) == '0' -- cgit v1.2.1