mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Revert "Merge pull request #1359 from Shopify/pz-instrument-range-floats"
This reverts commit300adfd7ae, reversing changes made toed0aebcbc9.
This commit is contained in:
@@ -31,33 +31,15 @@ class ExpressionTest < Minitest::Test
|
||||
assert_equal(3..4, parse_and_eval(" ( 3 .. 4 ) "))
|
||||
end
|
||||
|
||||
def test_instrument_range_float
|
||||
assert_usage_increment('range_float') do
|
||||
parse("(1.0..2.0)")
|
||||
end
|
||||
|
||||
assert_usage_increment('range_float') do
|
||||
parse("(1.0..2)")
|
||||
end
|
||||
|
||||
assert_usage_increment('range_float', times: 0) do
|
||||
parse("(1..2)")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def parse(markup)
|
||||
def parse_and_eval(markup, **assigns)
|
||||
if Liquid::Template.error_mode == :strict
|
||||
p = Liquid::Parser.new(markup)
|
||||
markup = p.expression
|
||||
p.consume(:end_of_string)
|
||||
end
|
||||
Liquid::Expression.parse(markup)
|
||||
end
|
||||
|
||||
def parse_and_eval(markup, **assigns)
|
||||
expression = parse(markup)
|
||||
expression = Liquid::Expression.parse(markup)
|
||||
context = Liquid::Context.new(assigns)
|
||||
context.evaluate(expression)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user