fix: comparison for empty/nil, fixes #321

This commit is contained in:
Jun Yang
2021-03-13 17:14:08 +08:00
parent aff9976042
commit 99d14e76d7
6 changed files with 36 additions and 11 deletions
+10
View File
@@ -79,4 +79,14 @@ describe('drop/empty-drop', function () {
const html = await liquid.parseAndRender(src)
expect(html).to.equal('true')
})
it('empty != empty', async function () {
const src = '{%if empty == empty %}true{%else%}false{% endif %}'
const html = await liquid.parseAndRender(src)
expect(html).to.equal('false')
})
it('empty != nil', async function () {
const src = '{%if empty == nil %}true{%else%}false{% endif %}'
const html = await liquid.parseAndRender(src)
expect(html).to.equal('false')
})
})