From f1d68409b18f285d5b958824dee2d1a8b9de3c4a Mon Sep 17 00:00:00 2001 From: ChenL Date: Wed, 15 Mar 2017 21:20:00 +0800 Subject: [PATCH] Do not throw error in contains when variable is illegal. --- test/syntax.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/syntax.js b/test/syntax.js index f0226a640..02cbe54dd 100644 --- a/test/syntax.js +++ b/test/syntax.js @@ -23,13 +23,6 @@ describe('expression', function() { expect(evalValue('"foo"')).to.equal("foo"); }); - it('should throw on illegal expression', function() { - expect(function() { - evalExp('1 contains "x"', scope); - evalExp('y contains "x"', scope); - }).to.throw(); - }); - it('should eval variables', function() { expect(evalValue('23', scope)).to.equal(23); expect(evalValue('one', scope)).to.equal(1); @@ -50,6 +43,8 @@ describe('expression', function() { expect(evalExp('one<=two', scope)).to.equal(true); expect(evalExp('x contains "x"', scope)).to.equal(false); expect(evalExp('x contains "X"', scope)).to.equal(true); + expect(evalExp('1 contains "x"', scope)).to.equal(false); + expect(evalExp('y contains "x"', scope)).to.equal(false); expect(evalExp('"<=" == "<="', scope)).to.equal(true); });