Compare commits

...

1 Commits

Author SHA1 Message Date
Peter Zhu
8493f95acb Test invalid floats 2020-11-05 09:35:23 -05:00
2 changed files with 13 additions and 1 deletions

View File

@@ -22,6 +22,6 @@ group :test do
gem 'rubocop-performance', require: false
platform :mri, :truffleruby do
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'master'
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'pz-fix-invalid-float'
end
end

View File

@@ -131,4 +131,16 @@ class ParsingQuirksTest < Minitest::Test
def test_contains_in_id
assert_template_result(' YES ', '{% if containsallshipments == true %} YES {% endif %}', 'containsallshipments' => true)
end
def test_invalid_float_with_no_leading_integer
with_error_mode(:lax) do
assert_template_result("", "{{ -.1 }}")
assert_template_result("", "{{ .1 }}")
end
with_error_mode(:strict) do
assert_raises(SyntaxError) { Template.parse("{{ -.1 }}") }
assert_raises(SyntaxError) { Template.parse("{{ .1 }}") }
end
end
end # ParsingQuirksTest