mirror of
https://github.com/kemko/liquid.git
synced 2026-01-02 08:15:41 +03:00
Compare commits
3 Commits
inline-com
...
pz-float-v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e98bb0d594 | ||
|
|
76dbb0d640 | ||
|
|
eab12e1240 |
2
Gemfile
2
Gemfile
@@ -22,6 +22,6 @@ group :test do
|
|||||||
gem 'rubocop-performance', require: false
|
gem 'rubocop-performance', require: false
|
||||||
|
|
||||||
platform :mri, :truffleruby do
|
platform :mri, :truffleruby do
|
||||||
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'master'
|
gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'pz-range-var-float'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ module Liquid
|
|||||||
case input
|
case input
|
||||||
when Integer
|
when Integer
|
||||||
input
|
input
|
||||||
when NilClass, String
|
when NilClass, String, Float
|
||||||
input.to_i
|
input.to_i
|
||||||
else
|
else
|
||||||
Utils.to_integer(input)
|
Utils.to_integer(input)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ class ExpressionTest < Minitest::Test
|
|||||||
def test_range
|
def test_range
|
||||||
assert_equal(1..2, parse_and_eval("(1..2)"))
|
assert_equal(1..2, parse_and_eval("(1..2)"))
|
||||||
assert_equal(3..4, parse_and_eval(" ( 3 .. 4 ) "))
|
assert_equal(3..4, parse_and_eval(" ( 3 .. 4 ) "))
|
||||||
|
assert_equal(1..2, parse_and_eval("(1.1..2.2)"))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ HERE
|
|||||||
|
|
||||||
def test_for_with_variable_range
|
def test_for_with_variable_range
|
||||||
assert_template_result(' 1 2 3 ', '{%for item in (1..foobar) %} {{item}} {%endfor%}', "foobar" => 3)
|
assert_template_result(' 1 2 3 ', '{%for item in (1..foobar) %} {{item}} {%endfor%}', "foobar" => 3)
|
||||||
|
assert_template_result(' 1 2 3 ', '{%for item in (x..y) %} {{item}} {%endfor%}', "x" => 1.1, "y" => 3.3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_for_with_hash_value_range
|
def test_for_with_hash_value_range
|
||||||
|
|||||||
Reference in New Issue
Block a user