mirror of https://github.com/tc39/test262.git
Improve errors in NumberFormat#formatToParts tests
Specify a descriptive value for the previously-unused third parameter of the `verifyFormatParts` function in order to disambiguate error messages. This patch was generated with the following command: sed -i 's/\(verifyFormatParts([^,]\+, \)\([^,]\+\))/\1\2, "\2")/g' \ test/intl402/NumberFormat/prototype/formatToParts/signDisplay-currency-*
This commit is contained in:
parent
7ce15a19f3
commit
1ad9bb7626
|
@ -60,11 +60,11 @@ const tests = [
|
|||
|
||||
for (const [signDisplay, negative, negativeNearZero, negativeZero, zero, positiveNearZero, positive] of tests) {
|
||||
const nf = new Intl.NumberFormat("de-DE", { style: "currency", currency: "USD", currencySign: "accounting", signDisplay });
|
||||
verifyFormatParts(nf.formatToParts(-987), negative);
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero);
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero);
|
||||
verifyFormatParts(nf.formatToParts(0), zero);
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero);
|
||||
verifyFormatParts(nf.formatToParts(987), positive);
|
||||
verifyFormatParts(nf.formatToParts(-987), negative, "negative");
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero, "negativeNearZero");
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero, "negativeZero");
|
||||
verifyFormatParts(nf.formatToParts(0), zero, "zero");
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero, "positiveNearZero");
|
||||
verifyFormatParts(nf.formatToParts(987), positive, "positive");
|
||||
}
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ const tests = [
|
|||
|
||||
for (const [signDisplay, negative, negativeNearZero, negativeZero, zero, positiveNearZero, positive] of tests) {
|
||||
const nf = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", currencySign: "accounting", signDisplay });
|
||||
verifyFormatParts(nf.formatToParts(-987), negative);
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero);
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero);
|
||||
verifyFormatParts(nf.formatToParts(0), zero);
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero);
|
||||
verifyFormatParts(nf.formatToParts(987), positive);
|
||||
verifyFormatParts(nf.formatToParts(-987), negative, "negative");
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero, "negativeNearZero");
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero, "negativeZero");
|
||||
verifyFormatParts(nf.formatToParts(0), zero, "zero");
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero, "positiveNearZero");
|
||||
verifyFormatParts(nf.formatToParts(987), positive, "positive");
|
||||
}
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ const tests = [
|
|||
|
||||
for (const [signDisplay, negative, negativeNearZero, negativeZero, zero, positiveNearZero, positive] of tests) {
|
||||
const nf = new Intl.NumberFormat("ja-JP", { style: "currency", currency: "USD", currencySign: "accounting", signDisplay });
|
||||
verifyFormatParts(nf.formatToParts(-987), negative);
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero);
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero);
|
||||
verifyFormatParts(nf.formatToParts(0), zero);
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero);
|
||||
verifyFormatParts(nf.formatToParts(987), positive);
|
||||
verifyFormatParts(nf.formatToParts(-987), negative, "negative");
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero, "negativeNearZero");
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero, "negativeZero");
|
||||
verifyFormatParts(nf.formatToParts(0), zero, "zero");
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero, "positiveNearZero");
|
||||
verifyFormatParts(nf.formatToParts(987), positive, "positive");
|
||||
}
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ const tests = [
|
|||
|
||||
for (const [signDisplay, negative, negativeNearZero, negativeZero, zero, positiveNearZero, positive] of tests) {
|
||||
const nf = new Intl.NumberFormat("ko-KR", { style: "currency", currency: "USD", currencySign: "accounting", signDisplay });
|
||||
verifyFormatParts(nf.formatToParts(-987), negative);
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero);
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero);
|
||||
verifyFormatParts(nf.formatToParts(0), zero);
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero);
|
||||
verifyFormatParts(nf.formatToParts(987), positive);
|
||||
verifyFormatParts(nf.formatToParts(-987), negative, "negative");
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero, "negativeNearZero");
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero, "negativeZero");
|
||||
verifyFormatParts(nf.formatToParts(0), zero, "zero");
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero, "positiveNearZero");
|
||||
verifyFormatParts(nf.formatToParts(987), positive, "positive");
|
||||
}
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ const tests = [
|
|||
|
||||
for (const [signDisplay, negative, negativeNearZero, negativeZero, zero, positiveNearZero, positive] of tests) {
|
||||
const nf = new Intl.NumberFormat("zh-TW", { style: "currency", currency: "USD", currencySign: "accounting", signDisplay });
|
||||
verifyFormatParts(nf.formatToParts(-987), negative);
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero);
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero);
|
||||
verifyFormatParts(nf.formatToParts(0), zero);
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero);
|
||||
verifyFormatParts(nf.formatToParts(987), positive);
|
||||
verifyFormatParts(nf.formatToParts(-987), negative, "negative");
|
||||
verifyFormatParts(nf.formatToParts(-0.0001), negativeNearZero, "negativeNearZero");
|
||||
verifyFormatParts(nf.formatToParts(-0), negativeZero, "negativeZero");
|
||||
verifyFormatParts(nf.formatToParts(0), zero, "zero");
|
||||
verifyFormatParts(nf.formatToParts(0.0001), positiveNearZero, "positiveNearZero");
|
||||
verifyFormatParts(nf.formatToParts(987), positive, "positive");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue