Skip to content

Commit

Permalink
Iterating over hash yields [key, value] pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
osteele committed Jul 17, 2017
1 parent 2c497e3 commit 67cb2e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tags/iteration_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."},
Expand Down
2 changes: 1 addition & 1 deletion tags/standard_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 67cb2e0

Please sign in to comment.