Add support for NumVariable expressions such as 2x fixes #6

This commit is contained in:
Mahdi Dibaiee
2015-06-18 16:14:13 +04:30
parent 2b3c06c413
commit c6973847aa
5 changed files with 111 additions and 22 deletions

View File

@ -30,6 +30,11 @@ describe('Equations', function () {
_expect.expect(equation).to['throw']();
});
it('should work with NumVariable expressions like 2x', function () {
var equation = _M2['default'].equation('2x + 6y');
_expect.expect(equation(4, 3)).to.equal(8 + 18);
});
it('Test case', function () {
var equation = _M2['default'].equation('2+x*(y+4)+z^2');
_expect.expect(equation(2, 4, 3)).to.equal(27);