mirror of https://github.com/tc39/test262.git
Temporal: Test daysInWeek when the week spans across years.
This commit is contained in:
parent
79e3bc5176
commit
3343e15083
|
@ -7,5 +7,11 @@ description: Basic tests for daysInWeek().
|
|||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const plainDate = new Temporal.PlainDate(1976, 11, 18);
|
||||
assert.sameValue(plainDate.daysInWeek, 7);
|
||||
const tests = [
|
||||
new Temporal.PlainDate(1976, 1, 1),
|
||||
new Temporal.PlainDate(1976, 11, 18),
|
||||
new Temporal.PlainDate(1976, 12, 31),
|
||||
];
|
||||
for (const plainDate of tests) {
|
||||
assert.sameValue(plainDate.daysInWeek, 7, `Seven days in the week of ${plainDate}`);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,11 @@ description: Checking days in week for a "normal" case (non-undefined, non-bound
|
|||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const calendar = Temporal.Calendar.from("iso8601");
|
||||
const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar);
|
||||
assert.sameValue(datetime.daysInWeek, 7, "check days in week information");
|
||||
const tests = [
|
||||
new Temporal.PlainDateTime(1976, 1, 1, 15, 23, 30, 123, 456, 789),
|
||||
new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789),
|
||||
new Temporal.PlainDateTime(1976, 12, 31, 15, 23, 30, 123, 456, 789),
|
||||
];
|
||||
for (const plainDateTime of tests) {
|
||||
assert.sameValue(plainDateTime.daysInWeek, 7, `Seven days in the week of ${plainDateTime}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue