mirror of https://github.com/tc39/test262.git
Change the unit in the NumberFormat unit tests.
This ensures https://github.com/tc39/proposal-unified-intl-numberformat/pull/93 is covered.
This commit is contained in:
parent
6ecaf1f065
commit
1f7f5ef23c
|
@ -13,56 +13,56 @@ const tests = [
|
|||
[
|
||||
-987,
|
||||
{
|
||||
"short": "-987 m",
|
||||
"narrow": "-987 m",
|
||||
"long": "-987 Meter",
|
||||
"short": "-987 km/h",
|
||||
"narrow": "-987 km/h",
|
||||
"long": "-987 Kilometer pro Stunde",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short": "-0,001 m",
|
||||
"narrow": "-0,001 m",
|
||||
"long": "-0,001 Meter",
|
||||
"short": "-0,001 km/h",
|
||||
"narrow": "-0,001 km/h",
|
||||
"long": "-0,001 Kilometer pro Stunde",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short": "-0 m",
|
||||
"narrow": "-0 m",
|
||||
"long": "-0 Meter",
|
||||
"short": "-0 km/h",
|
||||
"narrow": "-0 km/h",
|
||||
"long": "-0 Kilometer pro Stunde",
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short": "0 m",
|
||||
"narrow": "0 m",
|
||||
"long": "0 Meter",
|
||||
"short": "0 km/h",
|
||||
"narrow": "0 km/h",
|
||||
"long": "0 Kilometer pro Stunde",
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short": "0,001 m",
|
||||
"narrow": "0,001 m",
|
||||
"long": "0,001 Meter",
|
||||
"short": "0,001 km/h",
|
||||
"narrow": "0,001 km/h",
|
||||
"long": "0,001 Kilometer pro Stunde",
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short": "987 m",
|
||||
"narrow": "987 m",
|
||||
"long": "987 Meter",
|
||||
"short": "987 km/h",
|
||||
"narrow": "987 km/h",
|
||||
"long": "987 Kilometer pro Stunde",
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("de-DE", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("de-DE", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
assert.sameValue(nf.format(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,56 +13,56 @@ const tests = [
|
|||
[
|
||||
-987,
|
||||
{
|
||||
"short": "-987 m",
|
||||
"narrow": "-987m",
|
||||
"long": "-987 meters",
|
||||
"short": "-987 km/h",
|
||||
"narrow": "-987km/h",
|
||||
"long": "-987 kilometers per hour",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short": "-0.001 m",
|
||||
"narrow": "-0.001m",
|
||||
"long": "-0.001 meters",
|
||||
"short": "-0.001 km/h",
|
||||
"narrow": "-0.001km/h",
|
||||
"long": "-0.001 kilometers per hour",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short": "-0 m",
|
||||
"narrow": "-0m",
|
||||
"long": "-0 meters",
|
||||
"short": "-0 km/h",
|
||||
"narrow": "-0km/h",
|
||||
"long": "-0 kilometers per hour",
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short": "0 m",
|
||||
"narrow": "0m",
|
||||
"long": "0 meters",
|
||||
"short": "0 km/h",
|
||||
"narrow": "0km/h",
|
||||
"long": "0 kilometers per hour",
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short": "0.001 m",
|
||||
"narrow": "0.001m",
|
||||
"long": "0.001 meters",
|
||||
"short": "0.001 km/h",
|
||||
"narrow": "0.001km/h",
|
||||
"long": "0.001 kilometers per hour",
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short": "987 m",
|
||||
"narrow": "987m",
|
||||
"long": "987 meters",
|
||||
"short": "987 km/h",
|
||||
"narrow": "987km/h",
|
||||
"long": "987 kilometers per hour",
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("en-US", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("en-US", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
assert.sameValue(nf.format(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,56 +13,56 @@ const tests = [
|
|||
[
|
||||
-987,
|
||||
{
|
||||
"short": "-987 m",
|
||||
"narrow": "-987m",
|
||||
"long": "-987 メートル",
|
||||
"short": "-987 km/h",
|
||||
"narrow": "-987km/h",
|
||||
"long": "時速 -987 キロメートル",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short": "-0.001 m",
|
||||
"narrow": "-0.001m",
|
||||
"long": "-0.001 メートル",
|
||||
"short": "-0.001 km/h",
|
||||
"narrow": "-0.001km/h",
|
||||
"long": "時速 -0.001 キロメートル",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short": "-0 m",
|
||||
"narrow": "-0m",
|
||||
"long": "-0 メートル",
|
||||
"short": "-0 km/h",
|
||||
"narrow": "-0km/h",
|
||||
"long": "時速 -0 キロメートル",
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short": "0 m",
|
||||
"narrow": "0m",
|
||||
"long": "0 メートル",
|
||||
"short": "0 km/h",
|
||||
"narrow": "0km/h",
|
||||
"long": "時速 0 キロメートル",
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short": "0.001 m",
|
||||
"narrow": "0.001m",
|
||||
"long": "0.001 メートル",
|
||||
"short": "0.001 km/h",
|
||||
"narrow": "0.001km/h",
|
||||
"long": "時速 0.001 キロメートル",
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short": "987 m",
|
||||
"narrow": "987m",
|
||||
"long": "987 メートル",
|
||||
"short": "987 km/h",
|
||||
"narrow": "987km/h",
|
||||
"long": "時速 987 キロメートル",
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("ja-JP", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("ja-JP", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
assert.sameValue(nf.format(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,56 +13,56 @@ const tests = [
|
|||
[
|
||||
-987,
|
||||
{
|
||||
"short": "-987m",
|
||||
"narrow": "-987m",
|
||||
"long": "-987미터",
|
||||
"short": "-987km/h",
|
||||
"narrow": "-987km/h",
|
||||
"long": "시속 -987킬로미터",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short": "-0.001m",
|
||||
"narrow": "-0.001m",
|
||||
"long": "-0.001미터",
|
||||
"short": "-0.001km/h",
|
||||
"narrow": "-0.001km/h",
|
||||
"long": "시속 -0.001킬로미터",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short": "-0m",
|
||||
"narrow": "-0m",
|
||||
"long": "-0미터",
|
||||
"short": "-0km/h",
|
||||
"narrow": "-0km/h",
|
||||
"long": "시속 -0킬로미터",
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short": "0m",
|
||||
"narrow": "0m",
|
||||
"long": "0미터",
|
||||
"short": "0km/h",
|
||||
"narrow": "0km/h",
|
||||
"long": "시속 0킬로미터",
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short": "0.001m",
|
||||
"narrow": "0.001m",
|
||||
"long": "0.001미터",
|
||||
"short": "0.001km/h",
|
||||
"narrow": "0.001km/h",
|
||||
"long": "시속 0.001킬로미터",
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short": "987m",
|
||||
"narrow": "987m",
|
||||
"long": "987미터",
|
||||
"short": "987km/h",
|
||||
"narrow": "987km/h",
|
||||
"long": "시속 987킬로미터",
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("ko-KR", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("ko-KR", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
assert.sameValue(nf.format(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,56 +13,56 @@ const tests = [
|
|||
[
|
||||
-987,
|
||||
{
|
||||
"short": "-987 公尺",
|
||||
"narrow": "-987公尺",
|
||||
"long": "-987 公尺",
|
||||
"short": "-987 公里/小時",
|
||||
"narrow": "-987公里/小時",
|
||||
"long": "每小時 -987 公里",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short": "-0.001 公尺",
|
||||
"narrow": "-0.001公尺",
|
||||
"long": "-0.001 公尺",
|
||||
"short": "-0.001 公里/小時",
|
||||
"narrow": "-0.001公里/小時",
|
||||
"long": "每小時 -0.001 公里",
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short": "-0 公尺",
|
||||
"narrow": "-0公尺",
|
||||
"long": "-0 公尺",
|
||||
"short": "-0 公里/小時",
|
||||
"narrow": "-0公里/小時",
|
||||
"long": "每小時 -0 公里",
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short": "0 公尺",
|
||||
"narrow": "0公尺",
|
||||
"long": "0 公尺",
|
||||
"short": "0 公里/小時",
|
||||
"narrow": "0公里/小時",
|
||||
"long": "每小時 0 公里",
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short": "0.001 公尺",
|
||||
"narrow": "0.001公尺",
|
||||
"long": "0.001 公尺",
|
||||
"short": "0.001 公里/小時",
|
||||
"narrow": "0.001公里/小時",
|
||||
"long": "每小時 0.001 公里",
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short": "987 公尺",
|
||||
"narrow": "987公尺",
|
||||
"long": "987 公尺",
|
||||
"short": "987 公里/小時",
|
||||
"narrow": "987公里/小時",
|
||||
"long": "每小時 987 公里",
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("zh-TW", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("zh-TW", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
assert.sameValue(nf.format(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,73 +24,73 @@ const tests = [
|
|||
-987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"Meter"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"Kilometer pro Stunde"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"Meter"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"Kilometer pro Stunde"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"Meter"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"Kilometer pro Stunde"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"Meter"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"Kilometer pro Stunde"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"Meter"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":","},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"Kilometer pro Stunde"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"Meter"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"Kilometer pro Stunde"}],
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("de-DE", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("de-DE", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
verifyFormatParts(nf.formatToParts(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,73 +24,73 @@ const tests = [
|
|||
-987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"meters"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"kilometers per hour"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"meters"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"kilometers per hour"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"meters"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"kilometers per hour"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"meters"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"kilometers per hour"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"meters"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"kilometers per hour"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"meters"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"kilometers per hour"}],
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("en-US", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("en-US", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
verifyFormatParts(nf.formatToParts(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,73 +24,73 @@ const tests = [
|
|||
-987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"メートル"}],
|
||||
[{"type":"unit","value":"時速"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"キロメートル"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"メートル"}],
|
||||
[{"type":"unit","value":"時速"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"キロメートル"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"メートル"}],
|
||||
[{"type":"unit","value":"時速"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"キロメートル"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"メートル"}],
|
||||
[{"type":"unit","value":"時速"},{"type":"literal","value":" "},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"キロメートル"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"メートル"}],
|
||||
[{"type":"unit","value":"時速"},{"type":"literal","value":" "},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"キロメートル"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"メートル"}],
|
||||
[{"type":"unit","value":"時速"},{"type":"literal","value":" "},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"キロメートル"}],
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("ja-JP", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("ja-JP", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
verifyFormatParts(nf.formatToParts(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,73 +24,73 @@ const tests = [
|
|||
-987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"미터"}],
|
||||
[{"type":"unit","value":"시속"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"킬로미터"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"미터"}],
|
||||
[{"type":"unit","value":"시속"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"킬로미터"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"미터"}],
|
||||
[{"type":"unit","value":"시속"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"킬로미터"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"미터"}],
|
||||
[{"type":"unit","value":"시속"},{"type":"literal","value":" "},{"type":"integer","value":"0"},{"type":"unit","value":"킬로미터"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"미터"}],
|
||||
[{"type":"unit","value":"시속"},{"type":"literal","value":" "},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"킬로미터"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"m"}],
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"km/h"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"미터"}],
|
||||
[{"type":"unit","value":"시속"},{"type":"literal","value":" "},{"type":"integer","value":"987"},{"type":"unit","value":"킬로미터"}],
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("ko-KR", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("ko-KR", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
verifyFormatParts(nf.formatToParts(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,73 +24,73 @@ const tests = [
|
|||
-987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公里/小時"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"unit","value":"公里/小時"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"unit","value":"每小時"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公里"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公里/小時"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"公里/小時"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"unit","value":"每小時"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公里"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
-0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公里/小時"}],
|
||||
"narrow":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"unit","value":"公里/小時"}],
|
||||
"long":
|
||||
[{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"unit","value":"每小時"},{"type":"literal","value":" "},{"type":"minusSign","value":"-"},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公里"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公里/小時"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"integer","value":"0"},{"type":"unit","value":"公里/小時"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"unit","value":"每小時"},{"type":"literal","value":" "},{"type":"integer","value":"0"},{"type":"literal","value":" "},{"type":"unit","value":"公里"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
0.001,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公里/小時"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"unit","value":"公里/小時"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"unit","value":"每小時"},{"type":"literal","value":" "},{"type":"integer","value":"0"},{"type":"decimal","value":"."},{"type":"fraction","value":"001"},{"type":"literal","value":" "},{"type":"unit","value":"公里"}],
|
||||
}
|
||||
],
|
||||
[
|
||||
987,
|
||||
{
|
||||
"short":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公里/小時"}],
|
||||
"narrow":
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"integer","value":"987"},{"type":"unit","value":"公里/小時"}],
|
||||
"long":
|
||||
[{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公尺"}],
|
||||
[{"type":"unit","value":"每小時"},{"type":"literal","value":" "},{"type":"integer","value":"987"},{"type":"literal","value":" "},{"type":"unit","value":"公里"}],
|
||||
}
|
||||
],
|
||||
];
|
||||
|
||||
for (const [number, expectedData] of tests) {
|
||||
for (const [unitDisplay, expected] of Object.entries(expectedData)) {
|
||||
const nf = new Intl.NumberFormat("zh-TW", { style: "unit", unit: "meter", unitDisplay });
|
||||
const nf = new Intl.NumberFormat("zh-TW", { style: "unit", unit: "kilometer-per-hour", unitDisplay });
|
||||
verifyFormatParts(nf.formatToParts(number), expected);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue