fix: [expression] apply value equal for arrays, #589

This commit is contained in:
Harttle
2023-03-02 23:44:56 +08:00
parent 42d25902e8
commit 9c0dc5fa39
3 changed files with 38 additions and 10 deletions
+10
View File
@@ -400,4 +400,14 @@ describe('Issues', function () {
const html = await engine.parseAndRender(template, { str })
expect(html).to.match(/^\s*$/)
})
it('#589 Arrays should compare values', async() => {
const engine = new Liquid()
const template = `
{% assign people1 = "alice, bob, carol" | split: ", " -%}
{% assign people2 = "alice, bob, carol" | split: ", " -%}
{% if people1 == people2 %}true{%else%}false{% endif %}
`;
const html = await engine.parseAndRender(template)
expect(html).to.contain('true')
})
})