mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-17 21:40:39 -07:00
fix: [expression] apply value equal for arrays, #589
This commit is contained in:
@@ -53,6 +53,15 @@ describe('Expression', function () {
|
||||
it('should return false for "1==2"', async () => {
|
||||
expect(await toPromise(create('1==2').evaluate(ctx, false))).to.equal(false)
|
||||
})
|
||||
it('should apply deep equal for arrays', async () => {
|
||||
const ctx = new Context({
|
||||
arr1: [1, 2],
|
||||
arr2: [1, 2],
|
||||
arr3: [1, 2, 3],
|
||||
})
|
||||
expect(await toPromise(create('arr1==arr2').evaluate(ctx, false))).to.equal(true)
|
||||
expect(await toPromise(create('arr1==arr3').evaluate(ctx, false))).to.equal(false)
|
||||
})
|
||||
it('should return true for "1<2"', async () => {
|
||||
expect(await toPromise(create('1<2').evaluate(ctx, false))).to.equal(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user