From c7bbdd435f22b2c8d76d743f79d61e71e1b6286e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Fri, 21 Mar 2025 18:23:54 +0100 Subject: [PATCH] Remove test data from other calendars --- .../old/islamic-calendars-islamic-civil.js | 115 ++++------------ .../old/islamic-calendars-islamic-rgsa.js | 123 ++++++----------- .../old/islamic-calendars-islamic-tbla.js | 115 ++++------------ .../old/islamic-calendars-islamic-umalqura.js | 115 ++++------------ .../Temporal/old/islamic-calendars-islamic.js | 124 ++++++------------ 5 files changed, 150 insertions(+), 442 deletions(-) diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-civil.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-civil.js index b09dc3f1b4..7b9cf36fb2 100644 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-civil.js +++ b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-civil.js @@ -3,102 +3,35 @@ /*--- esid: sec-temporal-intl -description: Islamic calendars (note there are 5 variants) +description: Islamic calendar "islamic-civil". features: [Temporal] ---*/ +const calendar = "islamic-civil"; + // Test data obtained from ICU +const inLeapYear = true; +const daysInYear = 355; +const daysInMonth12 = 30; +const isoDate = "2023-07-19"; -const tests = [ - { - calendar: "islamic", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, +const year = 1445; +const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); +assert.sameValue(date.calendarId, calendar); +assert.sameValue(date.year, year); +assert.sameValue(date.month, 1); +assert.sameValue(date.monthCode, "M01"); +assert.sameValue(date.day, 1); - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-umalqura", - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-civil", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-rgsa", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, +assert.sameValue(date.inLeapYear, inLeapYear); +assert.sameValue(date.daysInYear, daysInYear); +assert.sameValue(date.monthsInYear, 12); +assert.sameValue(date.dayOfYear, 1); - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-tbla", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-18", - } -]; +const startOfNextYear = date.with({ year: year + 1 }); +const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); +assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); -for (const test of tests) { - const { calendar, choices = [test] } = test; - const year = 1445; - const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); - assert.sameValue(date.calendarId, calendar); - assert.sameValue(date.year, year); - assert.sameValue(date.month, 1); - assert.sameValue(date.monthCode, "M01"); - assert.sameValue(date.day, 1); - - // Match the possible choice by comparing the ISO date value. - const choice = choices.find(({ isoDate }) => { - return date.toString().startsWith(isoDate); - }); - assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); - - const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; - - assert.sameValue(date.inLeapYear, inLeapYear); - assert.sameValue(date.daysInYear, daysInYear); - assert.sameValue(date.monthsInYear, 12); - assert.sameValue(date.dayOfYear, 1); - const startOfNextYear = date.with({ year: year + 1 }); - const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); - assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); - const dateMonth12 = date.with({ month: 12 }); - assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); - assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); -} +const dateMonth12 = date.with({ month: 12 }); +assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); +assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js index b09dc3f1b4..b13ffd6407 100644 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js +++ b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js @@ -3,102 +3,57 @@ /*--- esid: sec-temporal-intl -description: Islamic calendars (note there are 5 variants) +description: Islamic calendar "islamic-rgsa". features: [Temporal] ---*/ +const calendar = "islamic-rgsa"; + // Test data obtained from ICU -const tests = [ +const choices = [ + // Approximations of the observational Islamic calendar as computed by ICU4C. { - calendar: "islamic", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, - - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-umalqura", inLeapYear: false, daysInYear: 354, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-civil", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-rgsa", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, - - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-tbla", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, + daysInMonth12: 29, isoDate: "2023-07-18", + }, + + // Approximations of the observational Islamic calendar as computed by ICU4X. + { + inLeapYear: true, + daysInYear: 355, + daysInMonth12: 30, + isoDate: "2023-07-19", } ]; -for (const test of tests) { - const { calendar, choices = [test] } = test; - const year = 1445; - const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); - assert.sameValue(date.calendarId, calendar); - assert.sameValue(date.year, year); - assert.sameValue(date.month, 1); - assert.sameValue(date.monthCode, "M01"); - assert.sameValue(date.day, 1); +const year = 1445; +const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); +assert.sameValue(date.calendarId, calendar); +assert.sameValue(date.year, year); +assert.sameValue(date.month, 1); +assert.sameValue(date.monthCode, "M01"); +assert.sameValue(date.day, 1); - // Match the possible choice by comparing the ISO date value. - const choice = choices.find(({ isoDate }) => { - return date.toString().startsWith(isoDate); - }); - assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); +// Match the possible choice by comparing the ISO date value. +const choice = choices.find(({ isoDate }) => { + return date.toString().startsWith(isoDate); +}); +assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); - const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; +const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; - assert.sameValue(date.inLeapYear, inLeapYear); - assert.sameValue(date.daysInYear, daysInYear); - assert.sameValue(date.monthsInYear, 12); - assert.sameValue(date.dayOfYear, 1); - const startOfNextYear = date.with({ year: year + 1 }); - const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); - assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); - const dateMonth12 = date.with({ month: 12 }); - assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); - assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); -} +assert.sameValue(date.inLeapYear, inLeapYear); +assert.sameValue(date.daysInYear, daysInYear); +assert.sameValue(date.monthsInYear, 12); +assert.sameValue(date.dayOfYear, 1); + +const startOfNextYear = date.with({ year: year + 1 }); +const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); +assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); + +const dateMonth12 = date.with({ month: 12 }); +assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); +assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-tbla.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-tbla.js index b09dc3f1b4..f500a14022 100644 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-tbla.js +++ b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-tbla.js @@ -3,102 +3,35 @@ /*--- esid: sec-temporal-intl -description: Islamic calendars (note there are 5 variants) +description: Islamic calendar "islamic-tbla". features: [Temporal] ---*/ +const calendar = "islamic-tbla"; + // Test data obtained from ICU +const inLeapYear = true; +const daysInYear = 355; +const daysInMonth12 = 30; +const isoDate = "2023-07-18"; -const tests = [ - { - calendar: "islamic", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, +const year = 1445; +const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); +assert.sameValue(date.calendarId, calendar); +assert.sameValue(date.year, year); +assert.sameValue(date.month, 1); +assert.sameValue(date.monthCode, "M01"); +assert.sameValue(date.day, 1); - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-umalqura", - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-civil", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-rgsa", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, +assert.sameValue(date.inLeapYear, inLeapYear); +assert.sameValue(date.daysInYear, daysInYear); +assert.sameValue(date.monthsInYear, 12); +assert.sameValue(date.dayOfYear, 1); - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-tbla", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-18", - } -]; +const startOfNextYear = date.with({ year: year + 1 }); +const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); +assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); -for (const test of tests) { - const { calendar, choices = [test] } = test; - const year = 1445; - const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); - assert.sameValue(date.calendarId, calendar); - assert.sameValue(date.year, year); - assert.sameValue(date.month, 1); - assert.sameValue(date.monthCode, "M01"); - assert.sameValue(date.day, 1); - - // Match the possible choice by comparing the ISO date value. - const choice = choices.find(({ isoDate }) => { - return date.toString().startsWith(isoDate); - }); - assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); - - const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; - - assert.sameValue(date.inLeapYear, inLeapYear); - assert.sameValue(date.daysInYear, daysInYear); - assert.sameValue(date.monthsInYear, 12); - assert.sameValue(date.dayOfYear, 1); - const startOfNextYear = date.with({ year: year + 1 }); - const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); - assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); - const dateMonth12 = date.with({ month: 12 }); - assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); - assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); -} +const dateMonth12 = date.with({ month: 12 }); +assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); +assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-umalqura.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-umalqura.js index b09dc3f1b4..8033c88bcd 100644 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-umalqura.js +++ b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-umalqura.js @@ -3,102 +3,35 @@ /*--- esid: sec-temporal-intl -description: Islamic calendars (note there are 5 variants) +description: Islamic calendar "islamic-umalqura". features: [Temporal] ---*/ +const calendar = "islamic-umalqura"; + // Test data obtained from ICU +const inLeapYear = false; +const daysInYear = 354; +const daysInMonth12 = 30; +const isoDate = "2023-07-19"; -const tests = [ - { - calendar: "islamic", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, +const year = 1445; +const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); +assert.sameValue(date.calendarId, calendar); +assert.sameValue(date.year, year); +assert.sameValue(date.month, 1); +assert.sameValue(date.monthCode, "M01"); +assert.sameValue(date.day, 1); - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-umalqura", - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-civil", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-rgsa", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, +assert.sameValue(date.inLeapYear, inLeapYear); +assert.sameValue(date.daysInYear, daysInYear); +assert.sameValue(date.monthsInYear, 12); +assert.sameValue(date.dayOfYear, 1); - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-tbla", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-18", - } -]; +const startOfNextYear = date.with({ year: year + 1 }); +const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); +assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); -for (const test of tests) { - const { calendar, choices = [test] } = test; - const year = 1445; - const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); - assert.sameValue(date.calendarId, calendar); - assert.sameValue(date.year, year); - assert.sameValue(date.month, 1); - assert.sameValue(date.monthCode, "M01"); - assert.sameValue(date.day, 1); - - // Match the possible choice by comparing the ISO date value. - const choice = choices.find(({ isoDate }) => { - return date.toString().startsWith(isoDate); - }); - assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); - - const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; - - assert.sameValue(date.inLeapYear, inLeapYear); - assert.sameValue(date.daysInYear, daysInYear); - assert.sameValue(date.monthsInYear, 12); - assert.sameValue(date.dayOfYear, 1); - const startOfNextYear = date.with({ year: year + 1 }); - const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); - assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); - const dateMonth12 = date.with({ month: 12 }); - assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); - assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); -} +const dateMonth12 = date.with({ month: 12 }); +assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); +assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js index b09dc3f1b4..764cd6e3dc 100644 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js +++ b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js @@ -3,102 +3,56 @@ /*--- esid: sec-temporal-intl -description: Islamic calendars (note there are 5 variants) +description: Islamic calendar "islamic". features: [Temporal] ---*/ -// Test data obtained from ICU +const calendar = "islamic"; -const tests = [ +// Test data obtained from ICU. +const choices = [ + // Approximations of the observational Islamic calendar as computed by ICU4C. { - calendar: "islamic", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, - - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-umalqura", inLeapYear: false, daysInYear: 354, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-civil", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - }, - { - calendar: "islamic-rgsa", - choices: [ - // Approximations of the observational Islamic calendar as computed by ICU4C. - { - inLeapYear: false, - daysInYear: 354, - daysInMonth12: 29, - isoDate: "2023-07-18", - }, - - // Approximations of the observational Islamic calendar as computed by ICU4X. - { - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, - isoDate: "2023-07-19", - } - ], - }, - { - calendar: "islamic-tbla", - inLeapYear: true, - daysInYear: 355, - daysInMonth12: 30, + daysInMonth12: 29, isoDate: "2023-07-18", + }, + + // Approximations of the observational Islamic calendar as computed by ICU4X. + { + inLeapYear: true, + daysInYear: 355, + daysInMonth12: 30, + isoDate: "2023-07-19", } ]; -for (const test of tests) { - const { calendar, choices = [test] } = test; - const year = 1445; - const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); - assert.sameValue(date.calendarId, calendar); - assert.sameValue(date.year, year); - assert.sameValue(date.month, 1); - assert.sameValue(date.monthCode, "M01"); - assert.sameValue(date.day, 1); +const year = 1445; +const date = Temporal.PlainDate.from({ year, month: 1, day: 1, calendar }); +assert.sameValue(date.calendarId, calendar); +assert.sameValue(date.year, year); +assert.sameValue(date.month, 1); +assert.sameValue(date.monthCode, "M01"); +assert.sameValue(date.day, 1); - // Match the possible choice by comparing the ISO date value. - const choice = choices.find(({ isoDate }) => { - return date.toString().startsWith(isoDate); - }); - assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); +// Match the possible choice by comparing the ISO date value. +const choice = choices.find(({ isoDate }) => { + return date.toString().startsWith(isoDate); +}); +assert(choice !== undefined, `No applicable choice found for calendar: ${calendar}`); - const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; +const { inLeapYear, daysInYear, daysInMonth12, isoDate } = choice; - assert.sameValue(date.inLeapYear, inLeapYear); - assert.sameValue(date.daysInYear, daysInYear); - assert.sameValue(date.monthsInYear, 12); - assert.sameValue(date.dayOfYear, 1); - const startOfNextYear = date.with({ year: year + 1 }); - const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); - assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); - const dateMonth12 = date.with({ month: 12 }); - assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); - assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date"); -} +assert.sameValue(date.inLeapYear, inLeapYear); +assert.sameValue(date.daysInYear, daysInYear); +assert.sameValue(date.monthsInYear, 12); +assert.sameValue(date.dayOfYear, 1); + +const startOfNextYear = date.with({ year: year + 1 }); +const lastDayOfThisYear = startOfNextYear.subtract({ days: 1 }); +assert.sameValue(lastDayOfThisYear.dayOfYear, daysInYear); + +const dateMonth12 = date.with({ month: 12 }); +assert.sameValue(dateMonth12.daysInMonth, daysInMonth12); +assert.sameValue(date.toString(), `${isoDate}[u-ca=${calendar}]`, "ISO reference date");