From e17cc7b4bf236e0e93f7907e785beb5f9687056b Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Sat, 17 Jul 2021 01:43:19 -0700 Subject: [PATCH] Add test for Temporal.Calendar.prototype.dateUntil --- .../prototype/date-until/largest-unit-day.js | 42 ++++++ .../date-until/largest-unit-month.js | 58 ++++++++ .../prototype/date-until/largest-unit-week.js | 46 +++++++ .../prototype/date-until/largest-unit-year.js | 124 ++++++++++++++++++ .../prototype/date-until/no-options.js | 32 +++++ .../date-until/throws-range-error.js | 27 ++++ 6 files changed, 329 insertions(+) create mode 100644 test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-day.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-month.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-week.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-year.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/date-until/no-options.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/date-until/throws-range-error.js diff --git a/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-day.js b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-day.js new file mode 100644 index 0000000000..d2f518b6c3 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-day.js @@ -0,0 +1,42 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Temporal.Calendar.prototype.dateUntil with largestUnit: "day" +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. Set one to ? ToTemporalDate(one). + 5. Set two to ? ToTemporalDate(two). + 6. Set options to ? GetOptionsObject(options). + 7. Let largestUnit be ? ToLargestTemporalUnit(options, « "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" », "auto", "day"). + 8. Let result be ! DifferenceISODate(one.[[ISOYear]], one.[[ISOMonth]], one.[[ISODay]], two.[[ISOYear]], two.[[ISOMonth]], two.[[ISODay]], largestUnit). + 9. Return ? CreateTemporalDuration(result.[[Years]], result.[[Months]], result.[[Weeks]], result.[[Days]], 0, 0, 0, 0, 0, 0). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +["day", "days"].forEach(function(largestUnit) { + let opt = {largestUnit}; + assert.sameValue("PT0S", cal.dateUntil("2021-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("P1D", cal.dateUntil("2021-07-16", "2021-07-17", opt).toJSON()); + assert.sameValue("P32D", cal.dateUntil("2021-07-16", "2021-08-17", opt).toJSON()); + assert.sameValue("P62D", cal.dateUntil("2021-07-16", "2021-09-16", opt).toJSON()); + assert.sameValue("P365D", + cal.dateUntil("2021-07-16", "2022-07-16", opt).toJSON()); + assert.sameValue("P3652D" + ,cal.dateUntil("2021-07-16", "2031-07-16", opt).toJSON()); + + assert.sameValue("-P1D", + cal.dateUntil("2021-07-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P32D", + cal.dateUntil("2021-08-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P62D", + cal.dateUntil("2021-09-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P365D", + cal.dateUntil("2022-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P3652D", + cal.dateUntil("2031-07-16", "2021-07-16", opt).toJSON()); +}); diff --git a/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-month.js b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-month.js new file mode 100644 index 0000000000..4b00884a2c --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-month.js @@ -0,0 +1,58 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Temporal.Calendar.prototype.dateUntil with largestUnit: "month" +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. Set one to ? ToTemporalDate(one). + 5. Set two to ? ToTemporalDate(two). + 6. Set options to ? GetOptionsObject(options). + 7. Let largestUnit be ? ToLargestTemporalUnit(options, « "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" », "auto", "day"). + 8. Let result be ! DifferenceISODate(one.[[ISOYear]], one.[[ISOMonth]], one.[[ISODay]], two.[[ISOYear]], two.[[ISOMonth]], two.[[ISODay]], largestUnit). + 9. Return ? CreateTemporalDuration(result.[[Years]], result.[[Months]], result.[[Weeks]], result.[[Days]], 0, 0, 0, 0, 0, 0). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +["month", "months"].forEach(function(largestUnit) { + let opt = {largestUnit}; + assert.sameValue("PT0S", cal.dateUntil("2021-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("P1D", cal.dateUntil("2021-07-16", "2021-07-17", opt).toJSON()); + assert.sameValue("P7D", cal.dateUntil("2021-07-16", "2021-07-23", opt).toJSON()); + assert.sameValue("P1M", cal.dateUntil("2021-07-16", "2021-08-16", opt).toJSON()); + assert.sameValue("P1M", cal.dateUntil("2020-12-16", "2021-01-16", opt).toJSON()); + assert.sameValue("P1M", cal.dateUntil("2021-01-05", "2021-02-05", opt).toJSON()); + assert.sameValue("P2M", cal.dateUntil("2021-01-07", "2021-03-07", opt).toJSON()); + assert.sameValue("P1M1D", cal.dateUntil("2021-07-16", "2021-08-17", opt).toJSON()); + assert.sameValue("P28D", cal.dateUntil("2021-07-16", "2021-08-13", opt).toJSON()); + assert.sameValue("P2M", cal.dateUntil("2021-07-16", "2021-09-16", opt).toJSON()); + assert.sameValue("P12M", + cal.dateUntil("2021-07-16", "2022-07-16", opt).toJSON()); + assert.sameValue("P120M" + ,cal.dateUntil("2021-07-16", "2031-07-16", opt).toJSON()); + + assert.sameValue("-P1D", + cal.dateUntil("2021-07-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1M1D", + cal.dateUntil("2021-08-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P28D", + cal.dateUntil("2021-08-13", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1M", + cal.dateUntil("2021-08-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1M3D", + cal.dateUntil("2021-08-16", "2021-07-13", opt).toJSON()); + assert.sameValue("-P2M", + cal.dateUntil("2021-09-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P2M5D", + cal.dateUntil("2021-09-21", "2021-07-16", opt).toJSON()); + assert.sameValue("-P12M", + cal.dateUntil("2022-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P12M1D", + cal.dateUntil("2022-07-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P120M", + cal.dateUntil("2031-07-16", "2021-07-16", opt).toJSON()); +}); diff --git a/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-week.js b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-week.js new file mode 100644 index 0000000000..b799546180 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-week.js @@ -0,0 +1,46 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Temporal.Calendar.prototype.dateUntil with largestUnit: "week" +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. Set one to ? ToTemporalDate(one). + 5. Set two to ? ToTemporalDate(two). + 6. Set options to ? GetOptionsObject(options). + 7. Let largestUnit be ? ToLargestTemporalUnit(options, « "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" », "auto", "day"). + 8. Let result be ! DifferenceISODate(one.[[ISOYear]], one.[[ISOMonth]], one.[[ISODay]], two.[[ISOYear]], two.[[ISOMonth]], two.[[ISODay]], largestUnit). + 9. Return ? CreateTemporalDuration(result.[[Years]], result.[[Months]], result.[[Weeks]], result.[[Days]], 0, 0, 0, 0, 0, 0). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +["week", "weeks"].forEach(function(largestUnit) { + let opt = {largestUnit}; + assert.sameValue("PT0S", cal.dateUntil("2021-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("P1D", cal.dateUntil("2021-07-16", "2021-07-17", opt).toJSON()); + assert.sameValue("P1W", cal.dateUntil("2021-07-16", "2021-07-23", opt).toJSON()); + assert.sameValue("P4W4D", cal.dateUntil("2021-07-16", "2021-08-17", opt).toJSON()); + assert.sameValue("P4W", cal.dateUntil("2021-07-16", "2021-08-13", opt).toJSON()); + assert.sameValue("P8W6D", cal.dateUntil("2021-07-16", "2021-09-16", opt).toJSON()); + assert.sameValue("P52W1D", + cal.dateUntil("2021-07-16", "2022-07-16", opt).toJSON()); + assert.sameValue("P521W5D" + ,cal.dateUntil("2021-07-16", "2031-07-16", opt).toJSON()); + + assert.sameValue("-P1D", + cal.dateUntil("2021-07-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P4W4D", + cal.dateUntil("2021-08-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P4W", + cal.dateUntil("2021-08-13", "2021-07-16", opt).toJSON()); + assert.sameValue("-P8W6D", + cal.dateUntil("2021-09-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P52W1D", + cal.dateUntil("2022-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P521W5D", + cal.dateUntil("2031-07-16", "2021-07-16", opt).toJSON()); +}); diff --git a/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-year.js b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-year.js new file mode 100644 index 0000000000..86617f25d5 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/date-until/largest-unit-year.js @@ -0,0 +1,124 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Temporal.Calendar.prototype.dateUntil with largestUnit: "year" +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. Set one to ? ToTemporalDate(one). + 5. Set two to ? ToTemporalDate(two). + 6. Set options to ? GetOptionsObject(options). + 7. Let largestUnit be ? ToLargestTemporalUnit(options, « "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" », "auto", "day"). + 8. Let result be ! DifferenceISODate(one.[[ISOYear]], one.[[ISOMonth]], one.[[ISODay]], two.[[ISOYear]], two.[[ISOMonth]], two.[[ISODay]], largestUnit). + 9. Return ? CreateTemporalDuration(result.[[Years]], result.[[Months]], result.[[Weeks]], result.[[Days]], 0, 0, 0, 0, 0, 0). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +["year", "years"].forEach(function(largestUnit) { + let opt = {largestUnit}; + assert.sameValue("PT0S", cal.dateUntil("2021-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("P1D", cal.dateUntil("2021-07-16", "2021-07-17", opt).toJSON()); + assert.sameValue("P7D", cal.dateUntil("2021-07-16", "2021-07-23", opt).toJSON()); + assert.sameValue("P1M", cal.dateUntil("2021-07-16", "2021-08-16", opt).toJSON()); + assert.sameValue("P1M", cal.dateUntil("2020-12-16", "2021-01-16", opt).toJSON()); + assert.sameValue("P1M", cal.dateUntil("2021-01-05", "2021-02-05", opt).toJSON()); + assert.sameValue("P2M", cal.dateUntil("2021-01-07", "2021-03-07", opt).toJSON()); + assert.sameValue("P1M1D", cal.dateUntil("2021-07-16", "2021-08-17", opt).toJSON()); + assert.sameValue("P28D", cal.dateUntil("2021-07-16", "2021-08-13", opt).toJSON()); + assert.sameValue("P2M", cal.dateUntil("2021-07-16", "2021-09-16", opt).toJSON()); + assert.sameValue("P1Y", + cal.dateUntil("2021-07-16", "2022-07-16", opt).toJSON()); + assert.sameValue("P1Y3D", + cal.dateUntil("2021-07-16", "2022-07-19", opt).toJSON()); + assert.sameValue("P1Y2M3D", + cal.dateUntil("2021-07-16", "2022-09-19", opt).toJSON()); + assert.sameValue("P10Y", + cal.dateUntil("2021-07-16", "2031-07-16", opt).toJSON()); + assert.sameValue("P10Y5M", + cal.dateUntil("2021-07-16", "2031-12-16", opt).toJSON()); + assert.sameValue("P23Y7M", + cal.dateUntil("1997-12-16", "2021-07-16", opt).toJSON()); + assert.sameValue("P24Y", + cal.dateUntil("1997-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("P23Y11M29D", + cal.dateUntil("1997-07-16", "2021-07-15", opt).toJSON()); + assert.sameValue("P23Y11M30D", + cal.dateUntil("1997-06-16", "2021-06-15", opt).toJSON()); + assert.sameValue("P60Y1M", + cal.dateUntil("1960-02-16", "2020-03-16", opt).toJSON()); + assert.sameValue("P61Y27D", + cal.dateUntil("1960-02-16", "2021-03-15", opt).toJSON()); + assert.sameValue("P60Y28D", + cal.dateUntil("1960-02-16", "2020-03-15", opt).toJSON()); + + assert.sameValue("P3M16D", + cal.dateUntil("2021-03-30", "2021-07-16", opt).toJSON()); + assert.sameValue("P1Y3M16D", + cal.dateUntil("2020-03-30", "2021-07-16", opt).toJSON()); + assert.sameValue("P61Y3M16D", + cal.dateUntil("1960-03-30", "2021-07-16", opt).toJSON()); + assert.sameValue("P1Y6M16D", + cal.dateUntil("2019-12-30", "2021-07-16", opt).toJSON()); + assert.sameValue("P6M16D", + cal.dateUntil("2020-12-30", "2021-07-16", opt).toJSON()); + assert.sameValue("P23Y6M16D", + cal.dateUntil("1997-12-30", "2021-07-16", opt).toJSON()); + assert.sameValue("P2019Y6M21D", + cal.dateUntil("0001-12-25", "2021-07-16", opt).toJSON()); + assert.sameValue("P1Y2M5D", + cal.dateUntil("2019-12-30", "2021-03-05", opt).toJSON()); + + assert.sameValue("-P1D", + cal.dateUntil("2021-07-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1M1D", + cal.dateUntil("2021-08-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P28D", + cal.dateUntil("2021-08-13", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1M", + cal.dateUntil("2021-08-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1M3D", + cal.dateUntil("2021-08-16", "2021-07-13", opt).toJSON()); + assert.sameValue("-P2M", + cal.dateUntil("2021-09-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P2M5D", + cal.dateUntil("2021-09-21", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1Y", + cal.dateUntil("2022-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1Y1D", + cal.dateUntil("2022-07-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P1Y3M1D", + cal.dateUntil("2022-10-17", "2021-07-16", opt).toJSON()); + assert.sameValue("-P10Y", + cal.dateUntil("2031-07-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P10Y11M", + cal.dateUntil("2032-07-16", "2021-08-16", opt).toJSON()); + + assert.sameValue("-P10Y5M", + cal.dateUntil("2031-12-16", "2021-07-16", opt).toJSON()); + assert.sameValue("-P13Y7M", + cal.dateUntil("2011-07-16", "1997-12-16", opt).toJSON()); + assert.sameValue("-P24Y", + cal.dateUntil("2021-07-16", "1997-07-16", opt).toJSON()); + assert.sameValue("-P23Y11M30D", + cal.dateUntil("2021-07-15", "1997-07-16", opt).toJSON()); + assert.sameValue("-P23Y11M29D", + cal.dateUntil("2021-06-15", "1997-06-16", opt).toJSON()); + assert.sameValue("-P60Y1M", + cal.dateUntil("2020-03-16", "1960-02-16", opt).toJSON()); + assert.sameValue("-P61Y28D", + cal.dateUntil("2021-03-15", "1960-02-16", opt).toJSON()); + assert.sameValue("-P60Y28D", + cal.dateUntil("2020-03-15", "1960-02-16", opt).toJSON()); + + assert.sameValue("-P61Y3M17D", + cal.dateUntil("2021-07-16", "1960-03-30", opt).toJSON()); + + assert.sameValue("-P2019Y6M22D", + cal.dateUntil("2021-07-16", "0001-12-25", opt).toJSON()); + assert.sameValue("-P23Y6M17D", + cal.dateUntil("2021-07-16", "1997-12-30", opt).toJSON()); +}); diff --git a/test/built-ins/Temporal/Calendar/prototype/date-until/no-options.js b/test/built-ins/Temporal/Calendar/prototype/date-until/no-options.js new file mode 100644 index 0000000000..e0eea3ecf8 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/date-until/no-options.js @@ -0,0 +1,32 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Temporal.Calendar.prototype.dateUntil w/o options +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. Set one to ? ToTemporalDate(one). + 5. Set two to ? ToTemporalDate(two). + 6. Set options to ? GetOptionsObject(options). + 7. Let largestUnit be ? ToLargestTemporalUnit(options, « "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" », "auto", "day"). + 8. Let result be ! DifferenceISODate(one.[[ISOYear]], one.[[ISOMonth]], one.[[ISODay]], two.[[ISOYear]], two.[[ISOMonth]], two.[[ISODay]], largestUnit). + 9. Return ? CreateTemporalDuration(result.[[Years]], result.[[Months]], result.[[Weeks]], result.[[Days]], 0, 0, 0, 0, 0, 0). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +assert.sameValue("PT0S", cal.dateUntil("2021-07-16", "2021-07-16").toJSON()); +assert.sameValue("P1D", cal.dateUntil("2021-07-16", "2021-07-17").toJSON()); +assert.sameValue("P32D", cal.dateUntil("2021-07-16", "2021-08-17").toJSON()); +assert.sameValue("P62D", cal.dateUntil("2021-07-16", "2021-09-16").toJSON()); +assert.sameValue("P365D", cal.dateUntil("2021-07-16", "2022-07-16").toJSON()); +assert.sameValue("P3652D", cal.dateUntil("2021-07-16", "2031-07-16").toJSON()); + +assert.sameValue("-P1D", cal.dateUntil("2021-07-17", "2021-07-16").toJSON()); +assert.sameValue("-P32D", cal.dateUntil("2021-08-17", "2021-07-16").toJSON()); +assert.sameValue("-P62D", cal.dateUntil("2021-09-16", "2021-07-16").toJSON()); +assert.sameValue("-P365D", cal.dateUntil("2022-07-16", "2021-07-16").toJSON()); +assert.sameValue("-P3652D", cal.dateUntil("2031-07-16", "2021-07-16").toJSON()); diff --git a/test/built-ins/Temporal/Calendar/prototype/date-until/throws-range-error.js b/test/built-ins/Temporal/Calendar/prototype/date-until/throws-range-error.js new file mode 100644 index 0000000000..0247a2c166 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/date-until/throws-range-error.js @@ -0,0 +1,27 @@ +// Copyright (C) 2021 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Temporal.Calendar.prototype.dateUntil throw RangeError on options +info: | + 1. Let calendar be the this value. + 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). + 3. Assert: calendar.[[Identifier]] is "iso8601". + 4. Set one to ? ToTemporalDate(one). + 5. Set two to ? ToTemporalDate(two). + 6. Set options to ? GetOptionsObject(options). + 7. Let largestUnit be ? ToLargestTemporalUnit(options, « "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" », "auto", "day"). + 8. Let result be ! DifferenceISODate(one.[[ISOYear]], one.[[ISOMonth]], one.[[ISODay]], two.[[ISOYear]], two.[[ISOMonth]], two.[[ISODay]], largestUnit). + 9. Return ? CreateTemporalDuration(result.[[Years]], result.[[Months]], result.[[Weeks]], result.[[Days]], 0, 0, 0, 0, 0, 0). +features: [Temporal] +---*/ +let cal = new Temporal.Calendar("iso8601"); + +// Test throw +[ "hour", "minute", "second", "millisecond", "microsecond", "nanosecond" ] +.forEach(function(largestUnit) { + assert.throws(RangeError, () => cal.dateUntil("2021-07-16", "2021-07-17", + {largestUnit}), + "Invalid unit argument for Temporal.Calendar.prototype.dateUntil() 'largestUnit'"); +});