1
0
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:
Oliver Steele 2017-07-17 12:21:39 -04:00
parent 2c497e3bbb
commit 67cb2e0462
2 changed files with 2 additions and 2 deletions

View File

@ -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."},

View File

@ -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"},