mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
UpdateNode.toTex: Fix syntax of assignment and fix test
This commit is contained in:
parent
55a66aeaaf
commit
2cd3da416e
@ -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;
|
||||
|
||||
@ -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 () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user