Skip to content

Commit

Permalink
Allow canonical era codes for Japanese era test
Browse files Browse the repository at this point in the history
  • Loading branch information
anba authored and ptomato committed Jul 25, 2024
1 parent 4a7c932 commit d4f8901
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/staging/Intl402/Temporal/old/japanese-era.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/*---
esid: sec-temporal-intl
description: Japanese eras
includes: [temporalHelpers.js]
features: [Temporal]
---*/

Expand Down Expand Up @@ -67,7 +68,10 @@ date = Temporal.PlainDate.from({
calendar: "japanese"
});
assert.sameValue(`${date}`, "1000-01-01[u-ca=japanese]");
assert.sameValue(date.era, "ce");
assert.sameValue(
TemporalHelpers.canonicalizeEraInCalendar(date, date.era),
TemporalHelpers.canonicalizeEraInCalendar(date, "ce"),
);
assert.sameValue(date.eraYear, 1000);

date = Temporal.PlainDate.from({
Expand All @@ -78,5 +82,8 @@ date = Temporal.PlainDate.from({
calendar: "japanese"
});
assert.sameValue(`${date}`, "0000-01-01[u-ca=japanese]");
assert.sameValue(date.era, "bce");
assert.sameValue(
TemporalHelpers.canonicalizeEraInCalendar(date, date.era),
TemporalHelpers.canonicalizeEraInCalendar(date, "bce"),
);
assert.sameValue(date.eraYear, 1);

0 comments on commit d4f8901

Please sign in to comment.