mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Fix internal liquid error when comparing hash with incompatible type (#849)
This commit is contained in:
committed by
GitHub
parent
ffb0ace303
commit
2bb3552033
@@ -64,6 +64,13 @@ class ConditionUnitTest < Minitest::Test
|
||||
assert_evaluates_argument_error '1', '<=', 0
|
||||
end
|
||||
|
||||
def test_hash_compare_backwards_compatibility
|
||||
assert_equal nil, Condition.new({}, '>', 2).evaluate
|
||||
assert_equal nil, Condition.new(2, '>', {}).evaluate
|
||||
assert_equal false, Condition.new({}, '==', 2).evaluate
|
||||
assert_equal true, Condition.new({ 'a' => 2 }, 'contains', 'a').evaluate
|
||||
end
|
||||
|
||||
def test_contains_works_on_arrays
|
||||
@context = Liquid::Context.new
|
||||
@context['array'] = [1, 2, 3, 4, 5]
|
||||
|
||||
Reference in New Issue
Block a user