Temporal: Fix Temporal/Duration/p/round tests (#4299)

This commit is contained in:
Tim Chevalier 2024-10-30 16:45:28 -07:00 committed by GitHub
parent 85934bf49c
commit 5505758111
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -12,5 +12,5 @@ const monthAlmostWeek = new Temporal.Duration(0, 1, 0, 6, 20, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(monthAlmostWeek.round({ TemporalHelpers.assertDuration(monthAlmostWeek.round({
smallestUnit: "days", 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); }), 0, 1, 0, 7, 0, 0, 0, 0, 0, 0);

View File

@ -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); const yearAndHalf = new Temporal.Duration(0, 0, 0, 547, 12, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(days.round({ 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); smallestUnit: "months"}), 0, 2, 0, 0, 0, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(days.negated().round({ 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); smallestUnit: "months"}), 0, -1, 0, 0, 0, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(yearAndHalf.round({ 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); smallestUnit: "years"}), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(yearAndHalf.round({ 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); smallestUnit: "years"}), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(yearAndHalf.round({ 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); smallestUnit: "years"}), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(yearAndHalf.round({ 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); smallestUnit: "years"}), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
TemporalHelpers.assertDuration(yearAndHalf.round({ 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); smallestUnit: "years"}), 2, 0, 0, 0, 0, 0, 0, 0, 0, 0);