Skip to content
Myr

made the recursive for loop test easier to debug

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 66a9344 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • tests:+2 added−2 removed

1 file+2 added−2 removed

modified:tests/test_forloop.py+2 added-2 removed
20 unmodified lines
21SCOPE = '''{% for item in seq %}{% endfor %}{{ item }}'''22VARLEN = '''{% for item in iter %}{{ item }}{% endfor %}'''23NONITER = '''{% for item in none %}...{% endfor %}'''24RECURSIVE = '''{% for item in seq recursive -%}25 [{{ item.a }}{% if item.b %}[{{ loop(item.b) }}]{% endif %}]25 [{{ item.a }}{% if item.b %}<{{ loop(item.b) }}>{% endif %}]26{%- endfor %}'''272829def test_simple(env):
59 unmodified lines
89 assert tmpl.render(seq=[90 dict(a=1, b=[dict(a=1), dict(a=2)]),91 dict(a=2, b=[dict(a=1), dict(a=2)]),92 dict(a=3, b=[dict(a='a')])93 ]) == '[1[[1][2]]][2[[1][2]]][3[[a]]]'93 ]) == '[1<[1][2]>][2<[1][2]>][3<[a]>]'