From 332ecf3d5dbcfd28591bd77b2b62f489d9e5ea25 Mon Sep 17 00:00:00 2001 From: Harry Sarson Date: Sat, 27 Jan 2018 14:21:36 +0000 Subject: [PATCH] adds failing test when implicit product is mapped --- test/expression/node/OperatorNode.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/expression/node/OperatorNode.test.js b/test/expression/node/OperatorNode.test.js index 91a4678c4..67d2b7b65 100644 --- a/test/expression/node/OperatorNode.test.js +++ b/test/expression/node/OperatorNode.test.js @@ -120,6 +120,14 @@ describe('OperatorNode', function() { assert.deepEqual(g.args[1], f); }); + it('should map an implicit OperatorNode', function () { + var x = new SymbolNode('x'); + var y = new SymbolNode('y'); + var product = new OperatorNode('*', 'multiply', [x, y], true /* implicit */); + + assert.deepEqual(product.map(function(x) { return x; }), product); + }); + it ('should throw an error when the map callback does not return a node', function () { var a = new SymbolNode('x'); var b = new ConstantNode(2);