1
0
mirror of https://github.com/MikeMcl/decimal.js.git synced 2024-10-27 20:34:12 +00:00
MikeMcl_decimal.js/test/test.js

75 lines
1005 B
JavaScript
Raw Normal View History

2016-02-06 17:51:29 +00:00
var time = new Date(),
passed = 0,
total = 0;
2016-01-25 00:11:32 +00:00
2016-03-09 22:54:34 +00:00
console.log('\n Testing decimal.js\n');
2016-01-25 00:11:32 +00:00
[
2016-02-06 17:51:29 +00:00
'abs',
'acos',
'acosh',
'asin',
'asinh',
'atan',
'atan2',
'atanh',
'cbrt',
'ceil',
'clone',
'cmp',
'config',
'cos',
'cosh',
'Decimal',
'div',
'divToInt',
'dpSd',
'exp',
'floor',
'hypot',
'immutability',
'intPow',
'isFiniteEtc',
'ln',
'log',
'log10',
'log2',
'minAndMax',
'minus',
'mod',
'neg',
'plus',
'pow',
'random',
'round',
'sign',
'sin',
'sinh',
'sqrt',
'tan',
'tanh',
'times',
'toBinary',
'toDP',
'toExponential',
'toFixed',
'toFraction',
'toHex',
'toNearest',
'toNumber',
'toOctal',
'toPrecision',
'toSD',
'toString',
'trunc',
2016-03-09 22:54:34 +00:00
'valueOf'
2016-01-25 00:11:32 +00:00
]
.forEach(function (module) {
require('./modules/' + module);
passed += T.result[0];
total += T.result[1];
});
2016-02-06 17:51:29 +00:00
time = new Date() - time;
2016-03-09 22:54:34 +00:00
console.log('\n In total, ' + passed + ' of ' + total + ' tests passed in ' + (time / 1e3) + ' secs.\n');