André Bargull
7ab6423e3a
Move two Intl.DateTimeFormat tests
2025-07-07 15:50:31 +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
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
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
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
8f7c679b9a
Add a test for ecma402#877 time zone canonicalization ( #4437 )
2025-03-26 10:54:55 -04:00
Tim Chevalier
ef4305ee4d
Fix comment ( #4430 )
2025-03-17 20:42:51 +00: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
75fddbd694
Add feature tag for "Time Zone Canonicalization"
2025-01-09 16:38:01 -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
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
Ben Allen
455cfa5a66
Add tests to Intl.DateTimeFormat
and Intl.RelativeTimeFormat
for various numbering systems ( #4276 )
...
* Add tests to `Intl.DateTimeFormat` and `Intl.RelativeTimeFormat` for formatting in various numbering systems
* fixup! Add tests to `Intl.DateTimeFormat` and `Intl.RelativeTimeFormat` for formatting in various numbering systems
2024-10-30 15:03:44 -07:00
Philip Chimento
e2f2f92486
Temporal: Add tests for formatting with no overlap between DTF options and Temporal object
...
See tc39/proposal-temporal#2795 . When attempting to format a Temporal
object, if the DateTimeFormat has options that do not overlap with the
data model of the Temporal object, toLocaleString() and format() are
supposed to throw a TypeError.
2024-10-07 12:02:45 +02:00
Philip Chimento
31a20380b0
Intl: Test calendar canonicalization in Intl.DateTimeFormat constructor
...
This ECMA-402 change is already from several years ago, but lacked test
coverage: https://github.com/tc39/ecma402/pull/418
2024-07-04 11:14:16 +02:00
Philip Chimento
7c985a4fd9
Make U+2212 MINUS SIGN an invalid sign character for offset time zone IDs
...
These are the test adjustments corresponding to the normative PR
https://github.com/tc39/ecma262/pull/3334 which reached consensus at the
June 2024 TC39 meeting.
2024-07-03 08:50:57 -07:00
Ben Allen
86b6eee25b
Correct Intl.DateTimeFormat and Intl.DisplayNames metadata incorrectly identifying tests for 'en' locale as tests for 'en-US'
2024-03-26 09:13:11 -07:00
André Bargull
263ed65292
Remove locales with explicit u-hc Unicode extension
...
The tests are passing an explicit `hour12` option, which disables any
`hourCycle` option and any `u-hc` Unicode extension. Therefore passing
input locales with `u-hc` is invalid.
```js
let locale = "en-u-hc-h24";
let hcDefault = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle;
assert.sameValue(hcDefault, "h24", "hour-cycle through Unicode extension");
let hc24 = new Intl.DateTimeFormat(locale, { hour: "numeric", hour12: false }).resolvedOptions().hourCycle;
// Incorrect assertion, because |hc24| uses |hour12|, which disables any
// hour-cycle option and the hour-cycle is determined from the locale "en".
// That means |hc24| will be "h23".
assert.sameValue(hc24, hcDefault);
```
2024-03-08 16:15:08 -08:00
André Bargull
53984cf8c5
Add test with non-IANA time zone names ( #4005 )
...
Time zone identifiers supported by ICU, but which aren't valid IANA
identifiers.
Implementations not supporting ECMA-402 are theoretically allowed to
support these identifiers, so the tests have to go into the "intl402"
directory.
2024-02-12 12:06:04 +01:00
Ben Allen
5e6f25bb4f
added clarifying comments on hourCycle-dateStyle.js
2023-10-02 14:39:52 -07:00
Ben Allen
5606c3012e
corrected hourCycle-default.js to handle language tags with -u-hc-h24 extension
2023-10-02 14:39:52 -07:00
Ben Allen
800d136d96
updated hourCycle-default.js to reflect new behaviour of hourCycle, which now associates h12 with h23 rather than h24. see https://github.com/tc39/ecma402/pull/758 .
2023-10-02 14:39:52 -07:00
Frank Yung-Fong Tang
6789b50cce
Add test for ECMA402 PR 788 ( #3917 )
...
* Add test for ECMA402 PR 788
https://github.com/tc39/ecma402/pull/788
* Fix misunderstanding about "+00:00"
* Fix lint
* Swap actual, expected position
* Update test/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-basic.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/prototype/formatToParts/offset-timezone-correct.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/constructor-invalid-offset-timezone.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/constructor-invalid-offset-timezone.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/prototype/resolvedOptions/offset-timezone-change.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/constructor-invalid-offset-timezone.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/prototype/format/offset-timezone-gmt-same.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/prototype/format/offset-timezone-gmt-same.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Update test/intl402/DateTimeFormat/prototype/formatToParts/offset-timezone-correct.js
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
---------
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
2023-09-26 09:22:50 -07:00
André Bargull
fe2c17bf4b
Use verifyProperty in test/intl402/DateTimeFormat tests
2023-09-13 16:05:40 +02:00
Justin Grant
90f5cac987
Add Intl.DTF tests for proposal-canonical-tz
2023-08-07 15:01:16 -07:00
Justin Grant
5d261f3641
Fix existing tests broken by proposal-canonical-tz
2023-08-07 15:01:16 -07:00
Ben Allen
a5e2cf2433
Update InitializeDateTimeFormat references to new CreateDateTimeFormat to reflect recent editorial change ( #3889 )
2023-08-07 17:01:48 +02:00
Ben Allen
5d9dc53a19
Test invalid Intl.DateTimeFormat options when dateStyle/timeStyle is set ( #3886 )
...
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2023-08-07 16:32:44 +02:00
André Bargull
21c3097f92
Update tests for PR "Read date-time options only once when creating DateTimeFormat objects"
...
Update tests for PR tc39/ecma402#709 .
2023-07-27 21:08:25 +02:00
Philip Chimento
cd714a9aad
Temporal: Rewrite Temporal.ZonedDateTime.p.toLocaleString tests
...
In https://github.com/tc39/proposal-temporal/pull/2522 which reached
consensus at the March 2023 TC39 meeting, the functionality of
Temporal.ZonedDateTime.p.toLocaleString was changed substantially, to not
directly pass the ZonedDateTime to any Intl.DateTimeFormat methods. This
adds rewrites of all existing tests for toLocaleString, as well as a few
tests to verify that Intl.DateTimeFormat methods no longer support
Temporal.ZonedDateTime arguments.
As we are rewriting the tests anyway, this also ports all of the
Temporal.ZonedDateTime.p.toLocaleString tests that were in staging, to the
correct format for the main tree.
2023-04-11 11:52:40 +02:00
Philip Chimento
960070549b
Store strings or objects in Temporal.ZonedDateTime [[TimeZone]] slot
...
Normative PR: https://github.com/tc39/proposal-temporal/pull/2482
2023-04-07 11:43:31 -07:00
José Julián Espina
4a6439e4a7
Add Array.prototype.includes
and exponentiation
features ( #3799 )
2023-03-23 10:51:08 +01:00
Richard Gibson
788bc809bf
Update DateTimeFormat proleptic Gregorian testing to include era ( #3722 )
...
Ref https://github.com/tc39/ecma402/issues/723
2023-02-01 11:50:39 -05:00
Justin Grant
2ac0d3c47b
Final batch of CLDR backwards-compatibility fixes
...
Following up on #3751 and #3762 , this commit makes a few tests
work on both CLDR 42 and CLDR 41. Previously these tests were
tied to a specific CLDR 42 format.
2023-01-11 10:22:26 +01:00
Justin Grant
2c599b020e
Fix more 402 Temporal tests broken by ICU72/CLDR42
...
Fixes 4 more Temporal-related tests that break in ICU 72 / CLDR 42.
Follows up on https://github.com/tc39/test262/pull/3676 and
https://github.com/tc39/test262/pull/3751 .
2023-01-10 10:30:51 -08:00
Ms2ger
6fcebf2f85
Improve NumberFormat and DateTimeFormat tests for OrdinaryHasInstance
2023-01-03 12:40:48 -08:00
André Bargull
7988e3eb65
Update expected results for CLDR 42
2022-11-29 11:59:25 +01:00
Frank Yung-Fong Tang
ab29fd3225
Sync to PR701 ( #3609 )
...
In 2022-07-20 TC39 we decide to take
https://github.com/tc39/ecma402/pull/701 and not check the order of the x and y
see https://docs.google.com/presentation/d/1UUvbf3FFu9PGtrPAKPdMad9DZuVFLIvkAsAxyJZyvxM/ for details
2022-07-21 13:30:08 -07:00
Jesse Alama
9c6e3aff38
Move to more sensible location
2022-02-28 14:37:03 -05:00