diff options
author | Adrian Moennich <adrian@planetcoding.net> | 2017-08-22 22:59:57 +0200 |
---|---|---|
committer | Adrian Moennich <adrian@planetcoding.net> | 2017-08-22 23:12:09 +0200 |
commit | cde2a54b87876bd02b283db2f52aca3d9272a92c (patch) | |
tree | 2cce6a0e6958fdb7d6c34cb9012f5216c2ab7d21 /tests/test_idtracking.py | |
parent | d117425f5ed3f542100f20d3bf700ae7bc54039f (diff) | |
download | jinja2-2.9-maintenance.tar.gz |
Compile `elif` tag to `elif` instead of `else: if`2.9-maintenance
This avoids deep nesting in case of many `{% elif .. %}` blocks (which
would fail during execution) and also deep recursion (which may fail
during compilation)
fixes #759
Diffstat (limited to 'tests/test_idtracking.py')
-rw-r--r-- | tests/test_idtracking.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_idtracking.py b/tests/test_idtracking.py index ea01b17..29312d3 100644 --- a/tests/test_idtracking.py +++ b/tests/test_idtracking.py @@ -61,7 +61,7 @@ def test_complex(): nodes.Output([ nodes.Name('title_upper', 'load'), nodes.Call(nodes.Name('render_title', 'load'), [ - nodes.Const('Aha')], [], None, None)])], [])])]) + nodes.Const('Aha')], [], None, None)])], [], [])])]) for_loop = nodes.For( nodes.Name('item', 'store'), @@ -155,7 +155,7 @@ def test_if_branching_stores(): tmpl = nodes.Template([ nodes.If(nodes.Name('expression', 'load'), [ nodes.Assign(nodes.Name('variable', 'store'), - nodes.Const(42))], [])]) + nodes.Const(42))], [], [])]) sym = symbols_for_node(tmpl) assert sym.refs == { @@ -177,7 +177,7 @@ def test_if_branching_stores_undefined(): nodes.Assign(nodes.Name('variable', 'store'), nodes.Const(23)), nodes.If(nodes.Name('expression', 'load'), [ nodes.Assign(nodes.Name('variable', 'store'), - nodes.Const(42))], [])]) + nodes.Const(42))], [], [])]) sym = symbols_for_node(tmpl) assert sym.refs == { @@ -197,7 +197,7 @@ def test_if_branching_stores_undefined(): def test_if_branching_multi_scope(): for_loop = nodes.For(nodes.Name('item', 'store'), nodes.Name('seq', 'load'), [ nodes.If(nodes.Name('expression', 'load'), [ - nodes.Assign(nodes.Name('x', 'store'), nodes.Const(42))], []), + nodes.Assign(nodes.Name('x', 'store'), nodes.Const(42))], [], []), nodes.Include(nodes.Const('helper.html'), True, False) ], [], None, False) |