mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 00:55:11 -07:00
Update test to support third argument
This commit is contained in:
@@ -855,16 +855,20 @@ class StandardFiltersTest < Minitest::Test
|
|||||||
["foo", 123, nil, true, false, Drop, ["foo"], { foo: "bar" }],
|
["foo", 123, nil, true, false, Drop, ["foo"], { foo: "bar" }],
|
||||||
]
|
]
|
||||||
test_types.each do |first|
|
test_types.each do |first|
|
||||||
test_types.each do |other|
|
test_types.each do |second|
|
||||||
(@filters.methods - Object.methods).each do |method|
|
test_types.each do |third|
|
||||||
arg_count = @filters.method(method).arity
|
(@filters.methods - Object.methods).each do |method|
|
||||||
arg_count *= -1 if arg_count < 0
|
arg_count = @filters.method(method).arity
|
||||||
inputs = [first]
|
arg_count *= -1 if arg_count < 0
|
||||||
inputs << ([other] * (arg_count - 1)) if arg_count > 1
|
inputs = [first]
|
||||||
begin
|
inputs << ([second] * (arg_count - 1)) if arg_count > 1
|
||||||
@filters.send(method, *inputs)
|
inputs << ([third] * (arg_count - 1)) if arg_count > 2
|
||||||
rescue Liquid::ArgumentError, Liquid::ZeroDivisionError
|
|
||||||
nil
|
begin
|
||||||
|
@filters.send(method, *inputs)
|
||||||
|
rescue Liquid::ArgumentError, Liquid::ZeroDivisionError
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user