mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
fix: comparison for empty/nil, fixes #321
This commit is contained in:
@@ -87,4 +87,12 @@ describe('Issues', function () {
|
||||
const html = await engine.parseAndRender(`{{ name | default: "default name" }}`)
|
||||
expect(html).to.equal('default name')
|
||||
})
|
||||
it('#321 comparison for empty/nil', async () => {
|
||||
const engine = new Liquid()
|
||||
const html = await engine.parseAndRender(
|
||||
'{% if empty == nil %}true{%else%}false{%endif%}' +
|
||||
'{% if nil == empty %}true{%else%}false{%endif%}'
|
||||
)
|
||||
expect(html).to.equal('falsefalse')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user