diff --git a/test/intl402/Temporal/PlainDate/prototype/since/leap-year-since.js b/test/intl402/Temporal/PlainDate/prototype/since/leap-year-since.js new file mode 100644 index 00000000000..3921ecc4761 --- /dev/null +++ b/test/intl402/Temporal/PlainDate/prototype/since/leap-year-since.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.since +description: Subtracting a date in a leap year from a date in a common year should work +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const calendar = 'chinese'; +const a = new Temporal.PlainDate(2016, 7, 31, calendar); +const b = new Temporal.PlainDate(2017, 7, 31, calendar); +TemporalHelpers.assertDuration(b.since(a, { largestUnit: 'years' }), + 0, 12, 0, 11, 0, 0, 0, 0, 0, 0); diff --git a/test/intl402/Temporal/PlainDate/prototype/until/leap-year-until.js b/test/intl402/Temporal/PlainDate/prototype/until/leap-year-until.js new file mode 100644 index 00000000000..47c54906469 --- /dev/null +++ b/test/intl402/Temporal/PlainDate/prototype/until/leap-year-until.js @@ -0,0 +1,16 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.until +description: Subtracting a date in a leap year from a date in a common year should work +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const calendar = 'hebrew'; +const a = new Temporal.PlainDate(1967, 2, 28, calendar); +const b = new Temporal.PlainDate(1968, 3, 1, calendar); +TemporalHelpers.assertDuration(a.until(b, { largestUnit: 'years' }), + 0, 12, 0, 13, 0, 0, 0, 0, 0, 0); +