fix: case/when array equality, #673

This commit is contained in:
Yang Jun
2024-04-28 23:17:01 +08:00
committed by Jun Yang
parent 8c7cef9f95
commit 2b630353c4
2 changed files with 15 additions and 1 deletions
+13
View File
@@ -119,4 +119,17 @@ describe('tags/case', function () {
'{%- endcase %}', {})
expect(result).toEqual('show this')
})
it('should apply value equal for arrays', () => {
const engine = new Liquid()
const result = engine.parseAndRenderSync(`
{%- assign x = "a,b,c" | split: "," %}
{%- assign y = "a,b,c" | split: "," %}
{% case x %}{% when y %}TRUE{% else %}FALSE{% endcase %}
{% if x == y %}TRUE{% else %}FALSE{% endif %}
`)
expect(result).toEqual(`
TRUE
TRUE
`)
})
})