From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../calendar-dateadd-called-with-options-undefined.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js') diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js index 5710b9c2b4..14a26aa8ef 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js @@ -14,27 +14,17 @@ features: [Temporal] const calendar = TemporalHelpers.calendarDateAddUndefinedOptions(); const timeZone = TemporalHelpers.oneShiftTimeZone(new Temporal.Instant(0n), 3600e9); const earlier = new Temporal.ZonedDateTime(0n, timeZone, calendar); - -// Basic difference with largestUnit larger than days. -// The call comes from this path: -// ZonedDateTime.until() -> DifferenceZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() - -const later1 = new Temporal.ZonedDateTime(1_213_200_000_000_000n, timeZone, calendar); -earlier.until(later1, { largestUnit: "weeks" }); -assert.sameValue(calendar.dateAddCallCount, 1, "basic difference with largestUnit >days"); +const later = new Temporal.ZonedDateTime(1_213_200_000_000_000n, timeZone, calendar); // Difference with rounding, with smallestUnit a calendar unit. // The calls come from these paths: // ZonedDateTime.until() -> -// DifferenceZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() // RoundDuration -> // MoveRelativeZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() // MoveRelativeDate -> calendar.dateAdd() // BalanceDurationRelative -> MoveRelativeDate -> calendar.dateAdd() -calendar.dateAddCallCount = 0; - -earlier.until(later1, { smallestUnit: "weeks" }); -assert.sameValue(calendar.dateAddCallCount, 4, "rounding difference with calendar smallestUnit"); +earlier.until(later, { smallestUnit: "weeks" }); +assert.sameValue(calendar.dateAddCallCount, 3, "rounding difference with calendar smallestUnit"); reportCompare(0, 0); -- cgit v1.2.3