Move the extra precision tests into separate files

This will allow implementations to test the rest of the number formatting tests,
even if the extra precision support isn't implemented.
This commit is contained in:
André Bargull 2018-09-24 08:49:39 -04:00 committed by Rick Waldron
parent 4bc96880a1
commit d9f67d53d1
4 changed files with 64 additions and 6 deletions

View File

@ -0,0 +1,32 @@
// Copyright 2011-2012 Norbert Lindenberg. All rights reserved.
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 11.3.2_TRF
description: >
Tests that the digits are determined correctly when specifying
pre/post decimal digits.
author: Norbert Lindenberg
includes: [testIntl.js]
---*/
var locales = [
new Intl.NumberFormat().resolvedOptions().locale,
"ar", "de", "th", "ja"
];
var numberingSystems = [
"arab",
"latn",
"thai",
"hanidec"
];
var testData = {
// Ref tc39/ecma402#128
"12344501000000000000000000000000000": "12344501000000000487815444678311936.0",
"-12344501000000000000000000000000000": "-12344501000000000487815444678311936.0"
};
testNumberFormat(locales, numberingSystems,
{useGrouping: false, minimumIntegerDigits: 3, minimumFractionDigits: 1, maximumFractionDigits: 3},
testData);

View File

@ -48,9 +48,6 @@ var testData = {
"-0.0000000012344501": "-000.0",
"123445.01": "123445.01",
"-123445.01": "-123445.01",
// Ref tc39/ecma402#128
"12344501000000000000000000000000000": "12344501000000000487815444678311936.0",
"-12344501000000000000000000000000000": "-12344501000000000487815444678311936.0"
};
testNumberFormat(locales, numberingSystems,

View File

@ -0,0 +1,32 @@
// Copyright 2011-2012 Norbert Lindenberg. All rights reserved.
// Copyright 2012 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 11.3.2_TRP
description: >
Tests that the digits are determined correctly when specifying
significant digits.
author: Norbert Lindenberg
includes: [testIntl.js]
---*/
var locales = [
new Intl.NumberFormat().resolvedOptions().locale,
"ar", "de", "th", "ja"
];
var numberingSystems = [
"arab",
"latn",
"thai",
"hanidec"
];
var testData = {
// Ref tc39/ecma402#128
"123.44500": "123.44",
"-123.44500": "-123.44",
};
testNumberFormat(locales, numberingSystems,
{useGrouping: false, minimumSignificantDigits: 3, maximumSignificantDigits: 5},
testData);

View File

@ -32,9 +32,6 @@ var testData = {
"-123.45": "-123.45",
"123.44499": "123.44",
"-123.44499": "-123.44",
// Ref tc39/ecma402#128
"123.44500": "123.44",
"-123.44500": "-123.44",
"123.44501": "123.45",
"-123.44501": "-123.45",
"0.001234": "0.001234",