mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
Fix mixed-short-and-numeric.js
The option for the listFormat need to include {type: "unit"}
This commit is contained in:
parent
a640565994
commit
c2ae5ed5e9
@ -7,6 +7,7 @@ description: Checks that durations containing a mixture of numericlike and non-n
|
|||||||
info: |
|
info: |
|
||||||
PartitionDurationFormatPattern ( durationFormat, duration )
|
PartitionDurationFormatPattern ( durationFormat, duration )
|
||||||
|
|
||||||
|
11. Perform ! CreateDataPropertyOrThrow(lfOpts, "type", "unit").
|
||||||
12. Let listStyle be durationFormat.[[Style]].
|
12. Let listStyle be durationFormat.[[Style]].
|
||||||
(...)
|
(...)
|
||||||
14. Perform ! CreateDataPropertyOrThrow(lfOpts, "style", listStyle).
|
14. Perform ! CreateDataPropertyOrThrow(lfOpts, "style", listStyle).
|
||||||
@ -27,7 +28,7 @@ expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "day", uni
|
|||||||
expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "hour", unitDisplay: "short"}).format(d.hours));
|
expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "hour", unitDisplay: "short"}).format(d.hours));
|
||||||
expectedList.push(new Intl.NumberFormat(locale).format(d.minutes) + timeSeparator + new Intl.NumberFormat(locale, {minimumIntegerDigits: 2}).format(d.seconds));
|
expectedList.push(new Intl.NumberFormat(locale).format(d.minutes) + timeSeparator + new Intl.NumberFormat(locale, {minimumIntegerDigits: 2}).format(d.seconds));
|
||||||
|
|
||||||
let expected = new Intl.ListFormat(locale, {style: "short"}).format(expectedList);
|
let expected = new Intl.ListFormat(locale, {type: "unit", style: "short"}).format(expectedList);
|
||||||
let actual = new Intl.DurationFormat(locale, dfOpts).format(d);
|
let actual = new Intl.DurationFormat(locale, dfOpts).format(d);
|
||||||
|
|
||||||
assert.sameValue(actual, expected);
|
assert.sameValue(actual, expected);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user