mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Test invalid floats
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user