1
0
mirror of https://github.com/MikeMcl/decimal.js.git synced 2026-09-22 20:04:09 +00:00

Mutation tests

This commit is contained in:
Jayson Harshbarger
2016-01-29 11:50:16 +09:00
parent b8b2ed7a2b
commit ec0955c28e
6 changed files with 24 additions and 10 deletions

View File

@@ -6,8 +6,10 @@ if (typeof T === 'undefined') require('../setup');
function t(n, expected, pr, rm) {
Decimal.precision = pr;
Decimal.rounding = rm;
var x = new Decimal(n);
T.assertEqual(expected, x.exp().valueOf());
T.assertEqual(expected, Decimal.exp(n).valueOf());
T.assertEqual(expected, new Decimal(n).exp().valueOf());
T.assert(x.eq(n) || x.isNaN());
}
Decimal.config({