mathjs/test/type/unit.js
2013-02-18 21:33:47 +01:00

17 lines
304 B
JavaScript

// test data type Unit
var assert = require('assert');
var math = require('../../math.js'),
Complex = math.type.Complex,
Unit = math.type.Unit;
var unit1 = new Unit(5000, 'cm');
assert.equal(unit1, '50 m');
assert.throws(function () {
Unit(2, 'inch');
});
// TODO: extensively test Unit