From eb848bb553650e5db98485f14de145eeadd3842d Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Thu, 3 Oct 2024 17:19:13 -0700 Subject: [PATCH] Temporal: Remove incorrect toLocaleString tests These staging tests are incorrect. See tc39/proposal-temporal#2795. This was an unintended behaviour. It differed from the behaviour for dateStyle and timeStyle, which was the intended behaviour. --- test/staging/Intl402/Temporal/old/date-toLocaleString.js | 6 ------ .../Intl402/Temporal/old/datetime-toLocaleString.js | 6 ------ .../Intl402/Temporal/old/monthday-toLocaleString.js | 8 -------- test/staging/Intl402/Temporal/old/time-toLocaleString.js | 7 ------- .../Intl402/Temporal/old/yearmonth-toLocaleString.js | 8 -------- 5 files changed, 35 deletions(-) diff --git a/test/staging/Intl402/Temporal/old/date-toLocaleString.js b/test/staging/Intl402/Temporal/old/date-toLocaleString.js index 8b90b223cc..a88c3820ed 100644 --- a/test/staging/Intl402/Temporal/old/date-toLocaleString.js +++ b/test/staging/Intl402/Temporal/old/date-toLocaleString.js @@ -25,9 +25,3 @@ assert.sameValue(`${ date.toLocaleString("en-US", { timeZone: "America/New_York" assert.sameValue(`${ date.toLocaleString("de-AT", { timeZone: "Europe/Vienna" }) }`, "18.11.1976"); var fmt = maybeGetWeekdayOnlyFormat(); if (fmt) assert.sameValue(fmt.format(date), "Thursday"); - -// should ignore units not in the data type -assert.sameValue(date.toLocaleString("en-US", { timeZoneName: "long" }), "11/18/1976"); -assert.sameValue(date.toLocaleString("en-US", { hour: "numeric" }), "11/18/1976"); -assert.sameValue(date.toLocaleString("en-US", { minute: "numeric" }), "11/18/1976"); -assert.sameValue(date.toLocaleString("en-US", { second: "numeric" }), "11/18/1976"); diff --git a/test/staging/Intl402/Temporal/old/datetime-toLocaleString.js b/test/staging/Intl402/Temporal/old/datetime-toLocaleString.js index c5889e0ecb..a02abc3167 100644 --- a/test/staging/Intl402/Temporal/old/datetime-toLocaleString.js +++ b/test/staging/Intl402/Temporal/old/datetime-toLocaleString.js @@ -37,12 +37,6 @@ assert.sameValue(`${datetime.toLocaleString("de-AT", { timeZone: "Europe/Vienna" var fmt = maybeGetWeekdayOnlyFormat(); if (fmt) assert.sameValue(fmt.format(datetime), "Thursday"); -// should ignore units not in the data type -assert.sameValue( - datetime.toLocaleString("en-US", { timeZoneName: "long" }), - `11/18/1976, 3:23:30${usDayPeriodSpace}PM` -); - // should use compatible disambiguation option var dstStart = new Temporal.PlainDateTime(2020, 3, 8, 2, 30); assert.sameValue( diff --git a/test/staging/Intl402/Temporal/old/monthday-toLocaleString.js b/test/staging/Intl402/Temporal/old/monthday-toLocaleString.js index 8b21023074..b00aa8d0fc 100644 --- a/test/staging/Intl402/Temporal/old/monthday-toLocaleString.js +++ b/test/staging/Intl402/Temporal/old/monthday-toLocaleString.js @@ -18,11 +18,3 @@ assert.sameValue(`${ monthday.toLocaleString("de-AT", { timeZone: "Europe/Vienna", calendar }) }`, "18.11."); - -// should ignore units not in the data type -assert.sameValue(monthday.toLocaleString("en-US", { timeZoneName: "long" }), "11/18"); -assert.sameValue(monthday.toLocaleString("en-US", { year: "numeric" }), "11/18"); -assert.sameValue(monthday.toLocaleString("en-US", { hour: "numeric" }), "11/18"); -assert.sameValue(monthday.toLocaleString("en-US", { minute: "numeric" }), "11/18"); -assert.sameValue(monthday.toLocaleString("en-US", { second: "numeric" }), "11/18"); -assert.sameValue(monthday.toLocaleString("en-US", { weekday: "long" }), "11/18"); diff --git a/test/staging/Intl402/Temporal/old/time-toLocaleString.js b/test/staging/Intl402/Temporal/old/time-toLocaleString.js index 1ab7b0776b..ec97be8615 100644 --- a/test/staging/Intl402/Temporal/old/time-toLocaleString.js +++ b/test/staging/Intl402/Temporal/old/time-toLocaleString.js @@ -18,10 +18,3 @@ const usDayPeriodSpace = var time = Temporal.PlainTime.from("1976-11-18T15:23:30"); assert.sameValue(`${time.toLocaleString("en-US", { timeZone: "America/New_York" })}`, `3:23:30${usDayPeriodSpace}PM`); assert.sameValue(`${time.toLocaleString("de-AT", { timeZone: "Europe/Vienna" })}`, "15:23:30"); - -// should ignore units not in the data type -assert.sameValue(time.toLocaleString("en-US", { timeZoneName: "long" }), `3:23:30${usDayPeriodSpace}PM`); -assert.sameValue(time.toLocaleString("en-US", { year: "numeric" }), `3:23:30${usDayPeriodSpace}PM`); -assert.sameValue(time.toLocaleString("en-US", { month: "numeric" }), `3:23:30${usDayPeriodSpace}PM`); -assert.sameValue(time.toLocaleString("en-US", { day: "numeric" }), `3:23:30${usDayPeriodSpace}PM`); -assert.sameValue(time.toLocaleString("en-US", { weekday: "long" }), `3:23:30${usDayPeriodSpace}PM`); diff --git a/test/staging/Intl402/Temporal/old/yearmonth-toLocaleString.js b/test/staging/Intl402/Temporal/old/yearmonth-toLocaleString.js index fc80d3bcac..da6a086881 100644 --- a/test/staging/Intl402/Temporal/old/yearmonth-toLocaleString.js +++ b/test/staging/Intl402/Temporal/old/yearmonth-toLocaleString.js @@ -29,11 +29,3 @@ assert.sameValue( `${yearmonth.toLocaleString("de-AT", { timeZone: "Europe/Vienna", calendar })}`, `11${deMonthYearSeparator}1976` ); - -// should ignore units not in the data type -assert.sameValue(yearmonth.toLocaleString("en-US", { timeZoneName: "long" }), "11/1976"); -assert.sameValue(yearmonth.toLocaleString("en-US", { day: "numeric" }), "11/1976"); -assert.sameValue(yearmonth.toLocaleString("en-US", { hour: "numeric" }), "11/1976"); -assert.sameValue(yearmonth.toLocaleString("en-US", { minute: "numeric" }), "11/1976"); -assert.sameValue(yearmonth.toLocaleString("en-US", { second: "numeric" }), "11/1976"); -assert.sameValue(yearmonth.toLocaleString("en-US", { weekday: "long" }), "11/1976");