mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 04:40:39 -07:00
fix: expression and string literal parser, #186
This commit is contained in:
@@ -65,8 +65,18 @@ describe('tags/if', function () {
|
||||
const html = await liquid.parseAndRender(src)
|
||||
return expect(html).to.equal('')
|
||||
})
|
||||
it('should allow no spaces around operator for literal', async function () {
|
||||
const src = `{% if true==true %}success{%else%}fail{% endif %}`
|
||||
const html = await liquid.parseAndRender(src)
|
||||
return expect(html).to.equal('success')
|
||||
})
|
||||
it('should allow no spaces around operator for variables', async function () {
|
||||
const src = `{%assign var = 1%}{%if var ==1%}success{%else%}fail{%endif%}`
|
||||
const html = await liquid.parseAndRender(src)
|
||||
return expect(html).to.equal('success')
|
||||
})
|
||||
})
|
||||
describe('comparasion to null', function () {
|
||||
describe('compare to null', function () {
|
||||
it('should evaluate false for null < 10', async function () {
|
||||
const src = '{% if null < 10 %}yes{% else %}no{% endif %}'
|
||||
const html = await liquid.parseAndRender(src, scope)
|
||||
|
||||
Reference in New Issue
Block a user