mirror of
https://github.com/danog/liquid.git
synced 2024-11-27 08:54:47 +01:00
Iterating over hash yields [key, value] pairs
This commit is contained in:
parent
2c497e3bbb
commit
67cb2e0462
@ -60,7 +60,7 @@ var iterationTests = []struct{ in, expected string }{
|
||||
{`{% for a in array %}{% if a == 'second' %}{% continue %}{% endif %}{{ a }}.{% endfor %}`, "first.third."},
|
||||
|
||||
// hash
|
||||
{`{% for a in hash %}{{ a }}{% endfor %}`, "a"},
|
||||
{`{% for a in hash %}{{ a[0] }}={{ a[1] }}.{% endfor %}`, "a=1."},
|
||||
|
||||
// cycle
|
||||
{`{% for a in array %}{% cycle 'even', 'odd' %}.{% endfor %}`, "even.odd.even."},
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
var parseErrorTests = []struct{ in, expected string }{
|
||||
{"{% unknown_tag %}", "unknown tag"},
|
||||
{"{% if syntax error %}", "unterminated if block"},
|
||||
{"{% if syntax error %}", `unterminated "if" block`},
|
||||
// TODO once expression parsing is moved to template parse stage
|
||||
// {"{% if syntax error %}{% endif %}", "parse error"},
|
||||
// {"{% for a in ar unknown %}{{ a }} {% endfor %}", "TODO"},
|
||||
|
Loading…
Reference in New Issue
Block a user