7381 Commits

Author SHA1 Message Date
Philip Chimento
4246feccce Intl Era Monthcode: Tests for addition around Gregorian-like leap years
Adds tests for addition and subtraction in the four calendars with
Gregorian-like leap years (buddhist, gregory, japanese, roc).
2025-11-19 11:12:01 +01:00
Tim Chevalier
3b2bc2c5b6 Temporal: Add tests for date differencing across era boundaries for Hijri and Ethiopic calendars 2025-11-18 21:58:11 -08:00
Philip Chimento
eb438e25e0
Intl Era Monthcode: Add feature missing from front matter (#4687) 2025-11-19 05:37:34 +00:00
Richard Gibson
cff5686028
harness: Remove typeCoercion.js BigInt/Symbol dependencies (#4683) 2025-11-19 00:46:51 +00:00
Tim Chevalier
7ab1a79c0e Temporal: Add tests for addition/subtraction across era boundaries for Hijri calendars 2025-11-18 16:32:11 -08:00
Tim Chevalier
29e8305d0f
Temporal: Tests for duration rounding and totaling (#4662)
* Temporal: Tests for duration rounding and totaling

This provides coverage for the bug in https://github.com/tc39/proposal-temporal/issues/3168

* Update test/built-ins/Temporal/Duration/prototype/total/rounding-window.js

---------

Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2025-11-18 15:15:51 -08:00
Frank Yung-Fong Tang
d086cbc2a8
Remove test for era formatting in iso8601 calendar (#4676)
Not specified, currently ILD. See https://github.com/tc39/ecma402/issues/1036
2025-11-18 09:27:32 -08:00
Philip Chimento
fb40b0e8aa Intl Era Monthcode: Add basic difference tests for ISO-like calendars
Basic difference tests for the four non-ISO calendars that use ISO-like
months and years (buddhist, gregory, japanese, roc).
2025-11-18 08:35:08 -08:00
Philip Chimento
9ec8f47e0e Intl Era Monthcode: Add basic addition tests for ISO-like calendars
Basic addition tests for the four non-ISO calendars that use ISO-like
months and years (buddhist, gregory, japanese, roc).
2025-11-18 08:35:08 -08:00
Philip Chimento
ed01bba772 Intl Era Monthcode: Fix reference ISO date for 2033-M11L in Chinese calendar
As per https://www.hko.gov.hk/en/gts/time/calendar/pdf/files/2033e.pdf
and https://taiwan-database.net/PDFs/WTFpdf23.pdf the leap month should
start on December 22 instead of 23.
2025-11-18 11:19:10 +01:00
Jesse Alama
464eb47200
Remove non-canonical values from Intl.supportedValuesOf("calendar") test (#4673)
Fixes #4639.
2025-11-18 10:16:13 +00:00
Tim Chevalier
875b3ee068
Temporal: Add test for formatting Temporal objects with era formatter (#4634)
See https://github.com/tc39/proposal-temporal/issues/3049
2025-11-17 23:20:16 -08:00
Ben Allen
3743134508 Update reference year for M11L in Chinese calendar to 2033 (supported date) instead of 1517 (date before our supported range) 2025-11-17 23:02:15 -08:00
Ben Allen
c125a8dc61 Added Intl.Era-monthcode feature for several tests 2025-11-17 11:57:40 -08:00
Philip Chimento
c3594286b4 Intl Era Monthcode: Add wrapping-at-end-of-month tests for Chinese/Dangi
Tests analogous to the Gregorian-like ones in the previous commit. For
example, when taking the difference between day 30 of a 30-day month and
day 29 of the following 29-day month, the result should be unambiguous
with respect to constraining: 29 days, not 1 month.
2025-11-17 14:33:11 +01:00
Philip Chimento
a68560c376 Intl Era Monthcode: Split up "wrapping-at-end-of-month-gregorian"
The name is confusing. It was intended to apply to all Gregorian-like
non-ISO calendars but when adding more calendar tests it seems to be
convenient to put each calendar's tests in their own file.

Use appropriate arithmetic years for each of the calendars.
2025-11-17 14:33:11 +01:00
Philip Chimento
8e3516bffd Intl Era Monthcode: Leap month tests for with() methods
Adds coverage for the constrain behaviour around leap months when using
the with() method to change the year, for the three calendars with leap
months.
2025-11-17 14:21:45 +01:00
Philip Chimento
359a303fb1 Intl Era Monthcode: Tests for mutually exclusive fields in with()
There was some coverage for mutually exclusive fields (month/monthCode,
and era+eraYear/year). This expands it to cover all supported calendars
and for PlainDateTime/ZonedDateTime as well.
2025-11-17 14:12:19 +01:00
Philip Chimento
8c87fb920b Intl Era Monthcode: Arithmetic year tests for non-ISO calendars
Tests the spec logic of determining the epoch year, and spot-checks
various other values of the arithmetic year given an era and era year.
2025-11-17 11:14:32 +01:00
Philip Chimento
8d2fba2d16 Temporal: Add ISO8601 PlainDate.p.with leap year test
This was not particularly well covered in the existing tests.
2025-11-17 10:55:58 +01:00
Philip Chimento
d12966d207 Temporal: Add ISO8601 PlainDate.p.with days constraining test
This was not particularly well covered in the existing tests.
2025-11-17 10:55:58 +01:00
Philip Chimento
f4367bc315 Temporal: Expand ISO8601 PlainDate.p.with tests
Move coverage of plural units to a separate file, and add some more
coverage for the overflow option.
2025-11-17 10:55:58 +01:00
Philip Chimento
2f0cc98718 Temporal: Add ISO8601 PlainDate.p.add days constraining test
This was not particularly well covered in the existing tests.
2025-11-17 10:55:58 +01:00
Philip Chimento
5d4feb344e Temporal: Expand ISO8601 PlainDate.p.add arithmetic tests
These were missing negative durations, as well as a test for ≥2 whole
years.
2025-11-17 10:55:58 +01:00
Philip Chimento
79bc9083fe Temporal: Reorganize ISO8601 PlainDate.p.until
Reorganize the PlainDate.p.until tests by topic ("basic arithmetic",
"leap years") to make them easier to adapt for non-ISO calendars.
2025-11-17 10:55:58 +01:00
Philip Chimento
b529669873 Temporal: Reorganize ISO8601 PlainDate.p.add tests
Reorganize the PlainDate.p.add tests by topic ("basic arithmetic", "leap
years") to make them easier to adapt for non-ISO calendars. A third
topic would be "constraining days" but it turns out that is barely
tested!
2025-11-17 10:55:58 +01:00
Philip Chimento
f95832e793 Intl Era Monthcode: Complete Hebrew leap month addition tests
This adds tests for overflow constrain/reject with years, expands the
coverage with months to test edge cases using 12, 13, 24, and 25 months,
and cleans up a bit.

I started to add weeks and days tests for this in the previous PR, but
on reflection I don't think those are that useful.
2025-11-14 14:29:43 +01:00
Philip Chimento
3ee7cf34da Intl Era Monthcode: Complete Chinese and Dangi leap month addition tests
This adds tests for overflow constrain/reject with years, expands the
coverage with months to test edge cases using 12, 13, 24, and 25 months,
and cleans up a bit.

Note the tests adding a number of years to get from a leap month in one
year to the same leap month in another year! 2012 has M04L in the
Chinese calendar and M03L in the Dangi calendar, so these are different
between the two calendars.
2025-11-14 14:22:56 +01:00
Philip Chimento
0fcfeb44a7 Intl Era Monthcode: Complete basic arithmetic tests for Chinese/Dangi
This adds basic tests for adding and subtracting years, and expands all
the existing addition tests to cover subtraction as well.
2025-11-14 14:16:14 +01:00
Philip Chimento
5ef162feaf Intl Era Monthcode: Complete basic arithmetic tests for Hebrew calendar
This adds basic tests for adding and subtracting years, months, and
weeks, and expands the existing days addition tests to cover subtraction
as well.
2025-11-14 13:57:24 +01:00
Philip Chimento
7168361b08 Intl Era Monthcode: Complete basic arithmetic tests for Hijri calendars
This adds basic tests for adding and subtracting years, weeks, and days.
2025-11-14 13:53:22 +01:00
Philip Chimento
2312907b9b Intl Era Monthcode: Fix up locale frontmatter for Hijri fallback
We don't require an en-u-ca-islamic locale to run this test, in fact
it's the intention that it will fall back to another Hijri calendar.
2025-11-13 10:23:20 -08:00
Jesse Alama
da2c2c98e8 Intl Era Monthcode: Test DateTimeFormat era formatting
Tests how Intl.DateTimeFormat formats eras in various calendars. The
actual output is implementation-defined, but we can test a few things:

- Calendars with multiple eras have distinct values for the era part
  when formatting dates in each era.
- Calendars with one era have the same value for the era part when
  formatting dates with positive and negative era years.
- Calendars without eras do not include an era part in the format.

Some calendars are missing from this test because their era
configurations were updated in CLDR 48. I will add those in a separate
PR which can be merged when implementations have had more time to update
to that version of CLDR.

Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-13 10:23:20 -08:00
Jesse Alama
3d23775387 Intl Era Monthcode: Exercise DateTimeFormat for leap months
This test calls Intl.DateTimeFormat.prototype.formatToParts() and
format() on dates in lunisolar calendars in leap and non-leap months.

The actual output is implementation-defined so there isn't much specific
that we can test here.

Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-13 10:23:20 -08:00
Jesse Alama
a4c57b679b Intl Era Monthcode: DateTimeFormat.resolvedOptions().calendar
Tests the Intl.DateTimeFormat.prototype.resolvedOptions().calendar value
for each supported calendar.

Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-13 10:23:20 -08:00
Tim Chevalier
0186d50ba0 Temporal: Test both "use" and "ignore" offsets
This test was previously only testing the "use" offset option
when testing valid strings.
2025-11-13 11:35:24 +01:00
Linus Groh
77b8a16b2f Fix %ThrowTypeError% cross-realm error check 2025-11-13 11:31:36 +01:00
Jihyeok Park
3e39d6060a Update ESMeta version to v0.7.1 2025-11-13 11:19:14 +01:00
André Bargull
bbaff82d73 Remove check for old nodejs versions
CLDR 48 changed the era name, so the output is now `"10/11/-79 Śaka"`.
This leads to taking the `vulnerableToBceBug == true` code path, which
then fails because no `RangeError` is thrown. Rather than adding the new
output, simply remove the lines to handle old nodejs versions.
2025-11-13 11:15:29 +01:00
Jesse Alama
d3ed08a68c Intl Era Monthcode: Era boundary difference in roc calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-12 11:55:57 +01:00
Jesse Alama
e5348a8202 Intl Era Monthcode: Era boundary difference in gregory calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-12 11:55:57 +01:00
Jesse Alama
34ca5ffdae Intl Era Monthcode: Era boundary difference in japanese calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-12 11:55:57 +01:00
Philip Chimento
883d4ece0b Expand current lunisolar leap months difference
This takes the current 'until-across-lunisolar-leap-months.js' which
didn't test much of anything too carefully, and expands it to cover
comprehensive date difference arithmetic across and including leap
months in the Chinese and Dangi calendars, for PlainDate, PlainDateTime,
and ZonedDateTime.

Hebrew calendar arithmetic will follow in a different PR.
2025-11-11 16:42:31 +01:00
Philip Chimento
8a3e85e099 Intl Era Monthcode: Add tests for Hebrew lunisolar leap month difference
Similar to #4652 - note that the expected results are different for the
cases labeled "exhibits calendar-specific constraining"! Covers date
difference arithmetic across and including leap months in the Hebrew
calendar, for PlainDate, PlainDateTime, and ZonedDateTime.
2025-11-11 16:34:33 +01:00
Jesse Alama
48c56238b6 Intl Era Monthcode: Era boundary tests for roc calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00
Jesse Alama
c7c9481e8c Intl Era Monthcode: Era boundary tests for japanese calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00
Jesse Alama
2ab10be334 Intl Era Monthcode: Era boundary tests for gregory calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00
Jesse Alama
f5d6f3474f Intl Era Monthcode: Era boundary tests for ethiopic calendar
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00
Jesse Alama
fc93996080 Intl Era Monthcode: Date addition tests for islamic calendars
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00
Ben Allen
90889d25cb Intl Era Monthcode: Date addition tests for hebrew calendar
Co-Authored-By: Jesse Alama <jesse@igalia.com>
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00