mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 11:20:41 -07:00
Merge pull request #416 from Shopify/filter-quirks
Make Filter Quirks Tests Actual Integration Tests
This commit is contained in:
@@ -91,12 +91,12 @@ class ParsingQuirksTest < Minitest::Test
|
|||||||
with_error_mode(:lax) do
|
with_error_mode(:lax) do
|
||||||
assert_template_result('hi',"{{ 'hi there' | split$$$:' ' | first }}")
|
assert_template_result('hi',"{{ 'hi there' | split$$$:' ' | first }}")
|
||||||
|
|
||||||
var = Variable.new("('x' | downcase)")
|
assert_template_result('x', "{{ 'X' | downcase) }}")
|
||||||
assert_equal [['downcase',[]]], var.filters
|
|
||||||
assert_equal "('x'", var.name
|
|
||||||
|
|
||||||
var = Variable.new("variant.title | escape | remove:\"\"\" | remove: \"'\"")
|
# After the messed up quotes a filter without parameters (reverse) should work
|
||||||
assert_equal [["escape", []], ["remove", ["\"\""]]], var.filters
|
# but one with parameters (remove) shouldn't be detected.
|
||||||
|
assert_template_result('here', "{{ 'hi there' | split:\"t\"\" | reverse | first}}")
|
||||||
|
assert_template_result('hi ', "{{ 'hi there' | split:\"t\"\" | remove:\"i\" | first}}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user