mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Support float in variable range
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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