5829 Commits

Author SHA1 Message Date
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
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
Ben Allen
c6789f4d50 Intl Era Monthcode: Date addition tests for chinese and dangi calendars
Co-Authored-By: Jesse Alama <jesse@igalia.com>
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-11-11 16:08:22 +01:00
Ron Buckton
fd594a077a Fix invalid async test for await-using syntax 2025-11-10 10:39:59 -08:00
André Bargull
55e4c18a69 Replace "closed" global variable in Math.sumPrecise test
This allows running the test in browsers, too.

<https://developer.mozilla.org/en-US/docs/Web/API/Window/closed>.
2025-11-10 09:41:50 -08:00
Olivier Flückiger
29860b3e42 [explicit-resource-management] Fix typo in using-for-using-of-of 2025-11-10 09:37:07 -08:00
Frank Yung-Fong Tang
beeffaf9f0
Sync test to https://github.com/tc39/proposal-intl-locale-info/pull/99
https://github.com/tc39/test262/pull/4417
2025-11-07 11:49:01 -08:00
Philip Chimento
f64d12fba5 Revert "Allow alternative era for Chinese calendar"
This reverts commit d124e1486c007a737411ea7110458e93680b7953 (#4309).
The Intl Era Monthcode proposal precludes this alternative era for the
Chinese calendar, so implementations that have it should not pass the
test.
2025-11-07 11:23:49 -08:00
Huáng Jùnliàng
2a1c3241a6 Mark using within default clause as negative 2025-11-07 11:09:33 -08:00
Ben Allen
dbb186bb07
Added Intl.Era-monthcode to features (#4617)
* Added Intl.Era-monthcode to features for some non-iso8601-related Temporal calendar tests
2025-11-07 11:03:43 -08:00
Philip Chimento
f1433632af
Temporal: Improve check for U+202F NARROW NO-BREAK SPACE in i10n formats (#4641) 2025-11-06 20:07:37 -05:00
Philip Chimento
5c07b52242 Temporal: Remove accidental octal literals from a test
These cause the test to fail in strict mode.
2025-11-06 11:32:55 +01:00
Tim Chevalier
ac3035f0d1 Add link to GitHub discussion 2025-11-05 15:42:18 -08:00
Tim Chevalier
df37207881 Temporal: Add test for CalendarYearMonthFromFields with Japanese dates
Japanese eras can begin in the middle of a month. This adds tests for
the existing behavior, which is that PlainYearMonth.from returns
a PlainYearMonth with an era matching the first day of the month,
even when that conflicts with the era given by the argument.

See https://github.com/tc39/proposal-temporal/issues/3150 for more details.
2025-11-05 15:42:18 -08:00
Ben Allen
a723c6ef96
Added test for Islamic calendar fallbacks [intl-era-monthcode] (#4627)
* New tests for islamic and islamic-rgsa calendar fallbacks with feature: Intl.Era-monthcode
2025-11-05 14:12:46 -08:00
Tim Chevalier
aa62607560 Fix indentation 2025-11-04 12:52:31 -08:00
Tim Chevalier
67ccaf966a Avoid creating extra objects 2025-11-04 12:52:31 -08:00
Tim Chevalier
88c06fe752 Update test/built-ins/Temporal/Instant/prototype/toString/negative-instant-rounding.js
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2025-11-04 12:52:31 -08:00
Tim Chevalier
d50ce09c59 Fix lint errors 2025-11-04 12:52:31 -08:00
Tim Chevalier
f1828f3ebf Add tests that trigger the same bug from Instant.toString and ZonedDateTime.toString 2025-11-04 12:52:31 -08:00
Tim Chevalier
ef55820458 Add tests for PlainDateTime and ZonedDateTime as well 2025-11-04 12:52:31 -08:00