mirror of https://github.com/tc39/test262.git
Temporal: Fix Temporal/Duration/p/round tests (#4299)
This commit is contained in:
parent
85934bf49c
commit
5505758111
|
@ -12,5 +12,5 @@ const monthAlmostWeek = new Temporal.Duration(0, 1, 0, 6, 20, 0, 0, 0, 0, 0);
|
|||
|
||||
TemporalHelpers.assertDuration(monthAlmostWeek.round({
|
||||
smallestUnit: "days",
|
||||
relativeTo: new PlainDate(2020, 1, 1)
|
||||
relativeTo: new Temporal.PlainDate(2020, 1, 1)
|
||||
}), 0, 1, 0, 7, 0, 0, 0, 0, 0, 0);
|
||||
|
|
|
@ -12,29 +12,29 @@ const days = new Temporal.Duration(0, 0, 0, 45, 0, 0, 0, 0, 0, 0);
|
|||
const yearAndHalf = new Temporal.Duration(0, 0, 0, 547, 12, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(days.round({
|
||||
relativeTo: new Temporal.PlainDate(2019, 1, 1)
|
||||
relativeTo: new Temporal.PlainDate(2019, 1, 1),
|
||||
smallestUnit: "months"}), 0, 2, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(days.negated().round({
|
||||
relativeTo: new Temporal.PlainDate(2019, 2, 15)
|
||||
relativeTo: new Temporal.PlainDate(2019, 2, 15),
|
||||
smallestUnit: "months"}), 0, -1, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(yearAndHalf.round({
|
||||
relativeTo: new Temporal.PlainDate(2018, 1, 1)
|
||||
relativeTo: new Temporal.PlainDate(2018, 1, 1),
|
||||
smallestUnit: "years"}), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(yearAndHalf.round({
|
||||
relativeTo: new Temporal.PlainDate(2018, 7, 1)
|
||||
relativeTo: new Temporal.PlainDate(2018, 7, 1),
|
||||
smallestUnit: "years"}), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(yearAndHalf.round({
|
||||
relativeTo: new Temporal.PlainDate(2019, 1, 1)
|
||||
relativeTo: new Temporal.PlainDate(2019, 1, 1),
|
||||
smallestUnit: "years"}), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(yearAndHalf.round({
|
||||
relativeTo: new Temporal.PlainDate(2020, 1, 1)
|
||||
relativeTo: new Temporal.PlainDate(2020, 1, 1),
|
||||
smallestUnit: "years"}), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
TemporalHelpers.assertDuration(yearAndHalf.round({
|
||||
relativeTo: new Temporal.PlainDate(2020, 7, 1)
|
||||
relativeTo: new Temporal.PlainDate(2020, 7, 1),
|
||||
smallestUnit: "years"}), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
|
|
Loading…
Reference in New Issue