808 Commits

Author SHA1 Message Date
Richard Gibson
fbc6833c24 Test that Intl.Locale language "root" is rejected
cf. https://unicode.org/reports/tr35/#unicode_bcp47_locale_id
2025-06-04 08:51:02 -07:00
Richard Gibson
a4501647e3 Improve test/intl402/Locale/constructor-getter-order.js
* Add a helper for concision
* Specify properties in a different order than the one used for reading
2025-06-04 10:57:38 +02:00
Richard Gibson
c2bfc5bdcd Add tests for Intl.Locale.prototype.variants
Ref https://github.com/tc39/ecma402/pull/960
2025-06-04 10:57:38 +02:00
André Bargull
95d90bf9f2 Add coverage for resolved locale when Unicode extensions and options are present
These tests currently fail in V8, but pass in JSC and SM.
2025-06-01 13:03:50 +02:00
Philip Chimento
5c9ff876dc Temporal: Add test coverage for sub-minute UTC offsets in strings
Expands and updates (following the normative change in
https://github.com/tc39/proposal-temporal/pull/3107, approved May 2025)
the current coverage with cases where the number of seconds is
incorrect, or rounded.

Adds missing coverage for sub-minute offsets in strings passed to
Temporal.ZonedDateTime.compare.

Adds the unusual test case of Pacific/Niue on October 15, 1952, where
the offset shifted by 20 seconds to a whole-minute boundary.

Fixes a few minor errors in the existing tests such as a missing ] in a
string, and the wrong sign for the offset in Africa/Monrovia in property
bags.
2025-05-31 20:46:32 +02:00
André Bargull
081cbfc975 Fix PluralRules notation test
- Change the locale to "fr", it's more likely to be present in
  implementations when compared to "sl".
- Test all possible "notation" values.
2025-05-26 15:02:48 +02:00
André Bargull
b3d0c57f7f Move PluralRules notation into correct directory 2025-05-26 15:02:48 +02:00
André Bargull
7d0984ba52 Fix bugs for PluralRules notation 2025-05-26 15:02:48 +02:00
André Bargull
3316c0aaf6 Test all combinations in temporal-plaindatetime-formatting-datetime-style 2025-05-22 14:24:47 +02:00
André Bargull
96695862e2 Test all combinations in temporal-plainyearmonth-formatting-datetime-style 2025-05-22 14:24:47 +02:00
André Bargull
a55bf7da9e Test all combinations in temporal-plainmonthday-formatting-datetime-style 2025-05-22 14:24:47 +02:00
André Bargull
24f6f7a014 Test all combinations in temporal-plaindate-formatting-datetime-style 2025-05-22 14:24:47 +02:00
André Bargull
c3db26368f Test all combinations in temporal-plaintime-formatting-datetime-style 2025-05-22 14:24:47 +02:00
André Bargull
36c81b9761 Split temporal-objects-formatting.js into separate files for each Temporal type 2025-05-22 14:24:47 +02:00
André Bargull
ef71f5e2a6 Fix expected result for short date-style
Compare to `dateTimeFormatterShortMedium`, which also uses the
`short` date-style.
2025-05-22 14:24:47 +02:00
André Bargull
e8e50b5746 Place closing parenthesis at the correct location 2025-05-22 14:24:47 +02:00
Ujjwal Sharma
453887559d Add 'notation' option to PluralRules tests and update related assertions
Refs: https://github.com/tc39/ecma402/pull/989
2025-05-14 10:43:30 -07:00
Philip Chimento
8fa9d38753
Temporal: Make gregory week numbers undefined (#4467) 2025-05-14 13:20:36 -04:00
Philip Chimento
118db52dd4
Temporal: Add coverage for getTimeZoneTransition edge cases (#4466)
getTimeZoneTransition return values should always correspond with UTC
offset transitions, not with time zone metadata changes such as making
DST permanent or updating abbreviation strings.

See: https://github.com/tc39/proposal-temporal/issues/3105
2025-05-14 13:04:43 -04:00
Philip Chimento
20d4558f39
Temporal: Add test coverage for close-together time zone transitions (#4471)
Check that implementations correctly detect time zone transitions that
are close together. Additionally, test startOfDay() since the time zone
transitions in Brazil occur at midnight.

See https://github.com/tc39/proposal-temporal/issues/3110
2025-05-14 12:27:19 -04:00
Richard Gibson
545df3a432
Fix front matter for test/intl402/Locale/prototype/region/prop-desc.js (#4475) 2025-05-08 18:53:11 -04:00
Philip Chimento
ac9ff9bf75 Add coverage for remapping of eras in Temporal dates
See note 2 on eras in CalendarResolveFields:
https://tc39.es/proposal-temporal/#sec-temporal-calendarresolvefields

This behaviour was not yet covered by any test262 tests.

Based on Anba's tests from https://github.com/tc39/test262/pull/4080 but
with different behaviour.
2025-04-29 13:45:50 +02:00
Tim Chevalier
64237beb0d Fix annotations 2025-04-23 11:51:56 -07:00
Tim Chevalier
0e0bf3c6bd Fix locale 2025-04-23 11:51:56 -07:00
Tim Chevalier
2107067d2e Rewrite tests to check for substrings rather than checking the entire output against an expected string 2025-04-23 11:51:56 -07:00
Tim Chevalier
c3b2287d2b Temporal: Add test for different combinations of DateTimeFormat options
This test file adds tests for all types of Temporal objects and various
combinations of style options for Intl.DateTimeFormat.
2025-04-23 11:51:56 -07:00
Philip Chimento
c3c318cf11 Temporal: Add coverage for weird PlainMonthDay leap day constrain case
If you have a leap day, such as February 29, and you get input such as
{ monthCode: "M02", day: 30 }, { overflow: "constrain" }, then you want
the day to be constrained to the leap day February 29, not February 28
as the maximum day would be in a common year. Add tests for this case
for each supported calendar.
2025-04-21 10:06:18 -07:00
Philip Chimento
fa0a3081bd Temporal: Increase coverage of dateStyle and timeStyle
Add coverage in particular for dateStyle: undefined and timeStyle:
undefined, and for dateStyle applying to PlainMonthDay/PlainYearMonth
which were not tested.
2025-04-21 10:06:18 -07:00
Philip Chimento
7c4a7999f0 Fix time zone canonicalization behaviour in DateTimeFormat test
As of the Time Zone Canonicalization proposal which is stage 3, the
original time zone name should be preserved in Intl.DateTimeFormat
.prototype.resolvedOptions.

Add a separate test that uses Temporal.ZonedDateTime.prototype.equals
to test the canonicalization behaviour.
2025-04-14 09:31:55 -07:00
Richard Gibson
afc3d1bce4 Refactor dayPeriod formatting tests to be robust to CLDR changes
Taken from Richard's suggestion in
https://github.com/tc39/test262/pull/4428#pullrequestreview-2691878561

Co-Authored-By: André Bargull <andre.bargull@gmail.com>
Co-Authored-By: Philip Chimento <pchimento@igalia.com>
2025-04-10 18:24:20 -07:00
Ujjwal Sharma
4ba104a21c Add test case for non-continental time zones
Adds a test that verifies that Intl.supportedValuesOf('timeZones')
includes those timezones those don't correspond to any continent. This
includes the oceanic Etc/* timezones and UTC.

Fixes: https://github.com/tc39/ecma402/issues/778
2025-03-27 17:38:56 +01:00
Ujjwal Sharma
8f7c679b9a
Add a test for ecma402#877 time zone canonicalization (#4437) 2025-03-26 10:54:55 -04:00
André Bargull
c23091151f Prefer "islamic-tbla" over "islamic" for Hijri calendars
"islamic" is underspecified because it doesn't include any information
which location and algorithms should be used to approximate new moon
observations. Instead switch to "islamic-tbla".
2025-03-24 10:39:29 +01:00
Tim Chevalier
ef4305ee4d
Fix comment (#4430) 2025-03-17 20:42:51 +00:00
André Bargull
d77a127c21 Fix expected maximumFractionDigits for compact notation
[[MaximumFractionDigits]] is set to zero in SetNumberFormatDigitOptions,
step 24.b.
2025-03-14 14:58:39 +01:00
André Bargull
4a611cbaca Fix expected value for UTC-like time zone
If `timeZone` should be preserved, then it can't be the same string as
`utcDateTime.timeZoneId`.
2025-03-14 11:39:12 +01:00
Philip Chimento
48bb262183 Update UTC time zone canonicalization to match proposal-canonical-tz
The test for https://github.com/tc39/ecma402/pull/724 (added in
https://github.com/tc39/test262/pull/4328) didn't take the Time Zone
Canonicalization proposal into account; but it should, because that
proposal is stage 3.

As of that proposal, the [[TimeZone]] slot of DateTimeFormat gets the
case-regularized original identifier, no longer the primary identifier. So
the resolvedOptions().timeZone property also no longer returns the primary
identifier.
2025-03-12 17:28:07 -07:00
André Bargull
e8c771e9df Add basic tests for Intl.DurationFormat accepting Temporal.Duration 2025-02-14 09:01:03 -08:00
lionel-rowe
6310295c80 Add Intl.Locale test for language getter where language subtag is "und" 2025-02-13 11:36:40 -08:00
Frank Yung-Fong Tang
37722d8826
Add test for useGrouping off in digital style of DurationFormat (#4208)
* Add test for useGrouping off in digital style of DurationFormat

Fix #4190

* change based on review feedback
2025-02-12 11:42:21 -08:00
Brage Hogstad
26db872ca7 Moved generic era and eraYear tests from intl402/Temporal to built-ins/Temporal 2025-02-12 11:36:45 -08:00
SUZUKI Sosuke
c85603ff11
DurationFormat: Add tests for durations with style: "digital", hoursDisplay: "auto" and zero hours (#4367)
Co-authored-by: André Bargull <andre.bargull@gmail.com>
2025-01-13 11:25:44 +01:00
André Bargull
75fddbd694 Add feature tag for "Time Zone Canonicalization" 2025-01-09 16:38:01 -08:00
André Bargull
122912d54b Remove invalid test that offset time zone are unsupported
Fixes #4339
2025-01-08 17:18:53 -08:00
André Bargull
c4317b0cb5 Ensure ToDateTimeFormattable is called for both arguments 2024-12-18 16:59:26 +01:00
André Bargull
d7fa2a1163 Remove "US/Pacific-New" from time zone tests
"US/Pacific-New" was removed in tzdata2020b.
2024-12-16 14:55:12 +01:00
André Bargull
d124e1486c Allow alternative era for Chinese calendar
Year 1 in the Chinese calendar corresponds to 2637 BCE in ICU4X.

See <https://docs.rs/icu/latest/icu/calendar/chinese/struct.Chinese.html#year-and-era-codes>.
2024-12-04 11:26:13 -08:00
Ben Allen
4053ff2eaf
Add tests for Intl.PluralRules.prototype.resolvedOptions().pluralCategories order (#4275)
Array elements should appear in following order: "zero", "one", "two", "few", "many", "other"

see https://github.com/tc39/ecma402/pull/918/
2024-12-03 13:38:58 +00:00
Ben Allen
bf9f54cb9d
Test that Intl.DateTimeFormat canonicalizes the timezones "Etc/GMT", "Etc/UTC", and "GMT" to "UTC" (#4328) 2024-11-18 09:20:01 +00:00
Philip Chimento
80c49657d3 Temporal: Fix name of constructor
I mistakenly committed something slightly different in my code review
suggestion than what I had modified locally.
2024-11-08 11:18:43 +01:00