mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
Add a rigid_parse method to cycle
This commit is contained in:
committed by
Guilherme Carreiro
parent
6d585a24f1
commit
c78bf20010
@@ -45,4 +45,19 @@ class CycleTagTest < Minitest::Test
|
||||
|
||||
assert_template_result("11", template)
|
||||
end
|
||||
|
||||
def test_cycle_tag_with_error_mode
|
||||
# QuotedFragment is more permissive than what Parser#expression allows.
|
||||
[:lax, :strict].each do |mode|
|
||||
with_error_mode(mode) do
|
||||
assert_template_result("a", "{% cycle .5: 'a', 'b' %}")
|
||||
assert_template_result("b", "{% assign 5 = 'b' %}{% cycle .5, .4 %}")
|
||||
end
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
assert_raises(Liquid::SyntaxError) { Template.parse("{% cycle .5: 'a', 'b' %}") }
|
||||
assert_raises(Liquid::SyntaxError) { Template.parse("{% cycle .5, .4 %}") }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user