From 25b3fd47ae7ba705158b5e7449136626fc033007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 30 May 2024 10:36:14 +0200 Subject: [PATCH] Move test for dates before start of the Japanese era into a new file See also requesting for more information how this case should actually be handled. --- .../Temporal/old/japanese-before-era.js | 64 +++++++++++++++++++ .../Intl402/Temporal/old/japanese-era.js | 55 ---------------- 2 files changed, 64 insertions(+), 55 deletions(-) create mode 100644 test/staging/Intl402/Temporal/old/japanese-before-era.js diff --git a/test/staging/Intl402/Temporal/old/japanese-before-era.js b/test/staging/Intl402/Temporal/old/japanese-before-era.js new file mode 100644 index 00000000000..d2ce7481b08 --- /dev/null +++ b/test/staging/Intl402/Temporal/old/japanese-before-era.js @@ -0,0 +1,64 @@ +// Copyright (C) 2018 Bloomberg LP. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal-intl +description: Japanese eras +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Dates in same year before Japanese era starts will resolve to previous era +var date = Temporal.PlainDate.from({ + era: "reiwa", + eraYear: 1, + month: 1, + day: 1, + calendar: "japanese" +}); +assert.sameValue(`${ date }`, "2019-01-01[u-ca=japanese]"); +assert.sameValue(date.era, "heisei"); +assert.sameValue(date.eraYear, 31); + +date = Temporal.PlainDate.from({ + era: "heisei", + eraYear: 1, + month: 1, + day: 1, + calendar: "japanese" +}); +assert.sameValue(`${ date }`, "1989-01-01[u-ca=japanese]"); +assert.sameValue(date.era, "showa"); +assert.sameValue(date.eraYear, 64); +date = Temporal.PlainDate.from({ + era: "showa", + eraYear: 1, + month: 1, + day: 1, + calendar: "japanese" +}); +assert.sameValue(`${ date }`, "1926-01-01[u-ca=japanese]"); +assert.sameValue(date.era, "taisho"); +assert.sameValue(date.eraYear, 15); + +date = Temporal.PlainDate.from({ + era: "taisho", + eraYear: 1, + month: 1, + day: 1, + calendar: "japanese" +}); +assert.sameValue(`${ date }`, "1912-01-01[u-ca=japanese]"); +assert.sameValue(date.era, "meiji"); +assert.sameValue(date.eraYear, 45); + +date = Temporal.PlainDate.from({ + era: "meiji", + eraYear: 1, + month: 1, + day: 1, + calendar: "japanese" +}); +assert.sameValue(`${ date }`, "1868-01-01[u-ca=japanese]"); +assert.sameValue(date.era, "ce"); +assert.sameValue(date.eraYear, 1868); diff --git a/test/staging/Intl402/Temporal/old/japanese-era.js b/test/staging/Intl402/Temporal/old/japanese-era.js index 17d2572cf4c..13c63eab5ee 100644 --- a/test/staging/Intl402/Temporal/old/japanese-era.js +++ b/test/staging/Intl402/Temporal/old/japanese-era.js @@ -58,61 +58,6 @@ var date = Temporal.PlainDate.from({ }); assert.sameValue(`${ date }`, "1869-01-01[u-ca=japanese]"); -// Dates in same year before Japanese era starts will resolve to previous era -var date = Temporal.PlainDate.from({ - era: "reiwa", - eraYear: 1, - month: 1, - day: 1, - calendar: "japanese" -}); -assert.sameValue(`${ date }`, "2019-01-01[u-ca=japanese]"); -assert.sameValue(date.era, "heisei"); -assert.sameValue(date.eraYear, 31); - -date = Temporal.PlainDate.from({ - era: "heisei", - eraYear: 1, - month: 1, - day: 1, - calendar: "japanese" -}); -assert.sameValue(`${ date }`, "1989-01-01[u-ca=japanese]"); -assert.sameValue(date.era, "showa"); -assert.sameValue(date.eraYear, 64); -date = Temporal.PlainDate.from({ - era: "showa", - eraYear: 1, - month: 1, - day: 1, - calendar: "japanese" -}); -assert.sameValue(`${ date }`, "1926-01-01[u-ca=japanese]"); -assert.sameValue(date.era, "taisho"); -assert.sameValue(date.eraYear, 15); - -date = Temporal.PlainDate.from({ - era: "taisho", - eraYear: 1, - month: 1, - day: 1, - calendar: "japanese" -}); -assert.sameValue(`${ date }`, "1912-01-01[u-ca=japanese]"); -assert.sameValue(date.era, "meiji"); -assert.sameValue(date.eraYear, 45); - -date = Temporal.PlainDate.from({ - era: "meiji", - eraYear: 1, - month: 1, - day: 1, - calendar: "japanese" -}); -assert.sameValue(`${ date }`, "1868-01-01[u-ca=japanese]"); -assert.sameValue(date.era, "ce"); -assert.sameValue(date.eraYear, 1868); - // Verify that CE and BCE eras (before Meiji) are recognized date = Temporal.PlainDate.from({ era: "ce",