Allow newlines in tags and variables.

This commit is contained in:
Dylan Thacker-Smith
2014-03-20 17:27:03 -04:00
parent face33a137
commit 3b14e27f55
11 changed files with 22 additions and 13 deletions
+4
View File
@@ -297,4 +297,8 @@ class StandardTagTest < Test::Unit::TestCase
assigns = {'array' => [ 1, 1, 1, 1] }
assert_template_result('1','{%for item in array%}{%ifchanged%}{{item}}{% endifchanged %}{%endfor%}',assigns)
end
def test_multiline_tag
assert_template_result '0 1 2 3', "0{%\nfor i in (1..3)\n%} {{\ni\n}}{%\nendfor\n%}"
end
end # StandardTagTest
+4
View File
@@ -197,4 +197,8 @@ class VariableResolutionTest < Test::Unit::TestCase
}
assert_equal "Unknown variable 'test'", e.message
end
def test_multiline_variable
assert_equal 'worked', Template.parse("{{\ntest\n}}").render!('test' => 'worked')
end
end # VariableTest