mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
feat: support not operator, #575
This commit is contained in:
@@ -154,6 +154,13 @@ describe('Expression', function () {
|
||||
const ctx = new Context({ obj: { foo: 'FOO' }, keys: { "what's this": 'foo' } })
|
||||
expect(await toPromise(create('obj[keys["what\'s this"]]').evaluate(ctx, false))).to.equal('FOO')
|
||||
})
|
||||
it('should support not', async function () {
|
||||
expect(await toPromise(create('not 1 < 2').evaluate(ctx))).to.equal(false)
|
||||
})
|
||||
it('not should have higher precedence than and/or', async function () {
|
||||
expect(await toPromise(create('not 1 < 2 or not 1 > 2').evaluate(ctx))).to.equal(true)
|
||||
expect(await toPromise(create('not 1 < 2 and not 1 > 2').evaluate(ctx))).to.equal(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('sync', function () {
|
||||
|
||||
Reference in New Issue
Block a user