Add support for NumVariable expressions such as 2x fixes #6
This commit is contained in:
5
dist/tests/equation.js
vendored
5
dist/tests/equation.js
vendored
@ -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);
|
||||
|
Reference in New Issue
Block a user