diff --git a/.gitignore b/.gitignore index 3c43542..d81a303 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,9 @@ ENV/ # IDE .vscode/ +# System +.DS_Store + # Dev utils dev.py dump_golden.py \ No newline at end of file diff --git a/liquid/golden/if_tag.py b/liquid/golden/if_tag.py index 8b93071..6025743 100644 --- a/liquid/golden/if_tag.py +++ b/liquid/golden/if_tag.py @@ -339,11 +339,38 @@ error=False, strict=False, ), + Case( + description="string contains string", + template="{% if 'hello' contains 'llo' %}TRUE{% else %}FALSE{% endif %}", + expect="TRUE", + globals={}, + partials={}, + error=False, + strict=False, + ), Case( description="string contains int", template="{% if 'hel9lo' contains 9 %}TRUE{% else %}FALSE{% endif %}", expect="TRUE", - globals={"x": {}}, + globals={}, + partials={}, + error=False, + strict=False, + ), + Case( + description="string contains string from context", + template="{% if 'hello' contains s %}TRUE{% else %}FALSE{% endif %}", + expect="TRUE", + globals={"s": "llo"}, + partials={}, + error=False, + strict=False, + ), + Case( + description="context string contains string from context", + template="{% if t contains s %}TRUE{% else %}FALSE{% endif %}", + expect="TRUE", + globals={"s": "llo", "t": "hello"}, partials={}, error=False, strict=False,