From 2cd3da416ea42a5f522354b66bb0785a9145efe8 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Fri, 17 Apr 2015 23:44:29 +0200 Subject: [PATCH] UpdateNode.toTex: Fix syntax of assignment and fix test --- lib/expression/node/UpdateNode.js | 2 +- test/expression/node/UpdateNode.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/expression/node/UpdateNode.js b/lib/expression/node/UpdateNode.js index 58c3b120c..eef548863 100644 --- a/lib/expression/node/UpdateNode.js +++ b/lib/expression/node/UpdateNode.js @@ -93,7 +93,7 @@ UpdateNode.prototype.toString = function() { * @return {String} */ UpdateNode.prototype._toTex = function(callbacks) { - return this.index.toTex(callbacks) + ' = ' + this.expr.toTex(callbacks); + return this.index.toTex(callbacks) + ':=' + this.expr.toTex(callbacks); }; module.exports = UpdateNode; diff --git a/test/expression/node/UpdateNode.test.js b/test/expression/node/UpdateNode.test.js index 5019b1d77..83a0c3ec4 100644 --- a/test/expression/node/UpdateNode.test.js +++ b/test/expression/node/UpdateNode.test.js @@ -319,7 +319,7 @@ describe('UpdateNode', function() { var v = new ConstantNode(5); var n = new UpdateNode(new IndexNode(a, ranges), v); - assert.equal(n.toString(), 'a[2, 1] = 5'); + assert.equal(n.toTex(), '\\mathrm{a}_{\\left[2,1\\right]}:=5'); }); it ('should LaTeX an UpdateNode with custom toTex', function () {