mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
Allow canonical era codes for Japanese era test
This commit is contained in:
parent
a238ad6a1e
commit
7f81bb2126
@ -4,6 +4,7 @@
|
|||||||
/*---
|
/*---
|
||||||
esid: sec-temporal-intl
|
esid: sec-temporal-intl
|
||||||
description: Japanese eras
|
description: Japanese eras
|
||||||
|
includes: [temporalHelpers.js]
|
||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
@ -67,7 +68,10 @@ date = Temporal.PlainDate.from({
|
|||||||
calendar: "japanese"
|
calendar: "japanese"
|
||||||
});
|
});
|
||||||
assert.sameValue(`${date}`, "1000-01-01[u-ca=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);
|
assert.sameValue(date.eraYear, 1000);
|
||||||
|
|
||||||
date = Temporal.PlainDate.from({
|
date = Temporal.PlainDate.from({
|
||||||
@ -78,5 +82,8 @@ date = Temporal.PlainDate.from({
|
|||||||
calendar: "japanese"
|
calendar: "japanese"
|
||||||
});
|
});
|
||||||
assert.sameValue(`${date}`, "0000-01-01[u-ca=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);
|
assert.sameValue(date.eraYear, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user