mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
test cloning of implicit multiplication
This commit is contained in:
parent
0dcd2f2ef4
commit
ed86eedf32
@ -176,6 +176,16 @@ describe('OperatorNode', function() {
|
||||
assert.strictEqual(d.args[1], c.args[1]);
|
||||
});
|
||||
|
||||
it ('should clone implicit multiplications', function () {
|
||||
var two = new ConstantNode(2);
|
||||
var x = new SymbolNode('x');
|
||||
var node = new OperatorNode('*', 'multiply', [two, x], true);
|
||||
|
||||
assert.equal('2 x', node.toString());
|
||||
assert.strictEqual(true, node.clone().implicit);
|
||||
assert.equal(node.toString(), node.clone().toString());
|
||||
});
|
||||
|
||||
it ('test equality another Node', function () {
|
||||
var a = new OperatorNode('+', 'add', [new SymbolNode('x'), new ConstantNode(2)]);
|
||||
var b = new OperatorNode('+', 'add', [new SymbolNode('x'), new ConstantNode(2)]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user