mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Compare commits
3 Commits
v5.0.1
...
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
|
||||
|
||||
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
|
||||
|
||||
@@ -29,7 +29,7 @@ module Liquid
|
||||
case input
|
||||
when Integer
|
||||
input
|
||||
when NilClass, String
|
||||
when NilClass, String, Float
|
||||
input.to_i
|
||||
else
|
||||
Utils.to_integer(input)
|
||||
|
||||
@@ -29,6 +29,7 @@ class ExpressionTest < Minitest::Test
|
||||
def test_range
|
||||
assert_equal(1..2, parse_and_eval("(1..2)"))
|
||||
assert_equal(3..4, parse_and_eval(" ( 3 .. 4 ) "))
|
||||
assert_equal(1..2, parse_and_eval("(1.1..2.2)"))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -50,6 +50,7 @@ HERE
|
||||
|
||||
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 (x..y) %} {{item}} {%endfor%}', "x" => 1.1, "y" => 3.3)
|
||||
end
|
||||
|
||||
def test_for_with_hash_value_range
|
||||
|
||||
Reference in New Issue
Block a user