diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /school/node_modules/object-inspect/test/number.js | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'school/node_modules/object-inspect/test/number.js')
-rw-r--r-- | school/node_modules/object-inspect/test/number.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/school/node_modules/object-inspect/test/number.js b/school/node_modules/object-inspect/test/number.js deleted file mode 100644 index 8f287e8..0000000 --- a/school/node_modules/object-inspect/test/number.js +++ /dev/null @@ -1,58 +0,0 @@ -var test = require('tape'); -var v = require('es-value-fixtures'); -var forEach = require('for-each'); - -var inspect = require('../'); - -test('negative zero', function (t) { - t.equal(inspect(0), '0', 'inspect(0) === "0"'); - t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); - - t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); - t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); - - t.end(); -}); - -test('numericSeparator', function (t) { - forEach(v.nonBooleans, function (nonBoolean) { - t['throws']( - function () { inspect(true, { numericSeparator: nonBoolean }); }, - TypeError, - inspect(nonBoolean) + ' is not a boolean' - ); - }); - - t.test('3 digit numbers', function (st) { - var failed = false; - for (var i = -999; i < 1000; i += 1) { - var actual = inspect(i); - var actualSepNo = inspect(i, { numericSeparator: false }); - var actualSepYes = inspect(i, { numericSeparator: true }); - var expected = String(i); - if (actual !== expected || actualSepNo !== expected || actualSepYes !== expected) { - failed = true; - t.equal(actual, expected); - t.equal(actualSepNo, expected); - t.equal(actualSepYes, expected); - } - } - - st.notOk(failed, 'all 3 digit numbers passed'); - - st.end(); - }); - - t.equal(inspect(1e3), '1000', '1000'); - t.equal(inspect(1e3, { numericSeparator: false }), '1000', '1000, numericSeparator false'); - t.equal(inspect(1e3, { numericSeparator: true }), '1_000', '1000, numericSeparator true'); - t.equal(inspect(-1e3), '-1000', '-1000'); - t.equal(inspect(-1e3, { numericSeparator: false }), '-1000', '-1000, numericSeparator false'); - t.equal(inspect(-1e3, { numericSeparator: true }), '-1_000', '-1000, numericSeparator true'); - - t.equal(inspect(1234.5678, { numericSeparator: true }), '1_234.567_8', 'fractional numbers get separators'); - t.equal(inspect(1234.56789, { numericSeparator: true }), '1_234.567_89', 'fractional numbers get separators'); - t.equal(inspect(1234.567891, { numericSeparator: true }), '1_234.567_891', 'fractional numbers get separators'); - - t.end(); -}); |