Commit Graph

130 Commits

Author SHA1 Message Date
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
Jesse Alama 10f9a69295 Move test to a more sensible location
Also, use a more sensible ID as well. Add another test (for
Date values).
2022-02-28 14:37:03 -05:00
Philip Chimento ae53326189 Test TypeError is thrown when getOffsetNanosecondsFor is not callable
Tests for the normative changes made to Temporal in
https://github.com/tc39/proposal-temporal/pull/1829
In a previous version of the specification, there was a fallback to the
intrinsic getOffsetNanosecondsFor when it was undefined.
2021-11-16 17:06:06 -05:00
Mike Pennisi f527a107f2 Relax tests for resolvedOptions property ordering
A number of tests for ECMA402 asserted the exact contents of the array
returned by various `resolvedOptions` methods. This conflicted with the
expectation that more options will be introduced by future editions of
the specification.

Update these tests to assert property order more generically in order to
accommodate implementation of future language proposals and more closely
align with similar tests.

Update all `resolvedOptions` tests to produce more meaningful error
messages (including replacing the generic `arrayContains` assertion with
a specific assertion regarding the value of the first array element).
2021-10-29 15:19:27 -04:00
Philip Chimento 77a34cf93f Add Temporal tests
This copies over the tests that previously existed in the
tc39/proposal-temporal repository.

For context, see thread starting at:
https://github.com/tc39/test262/issues/3002#issuecomment-926234480

In service of https://github.com/tc39/test262/issues/3002
2021-10-01 14:30:12 -04:00
André Bargull 71460edfeb Add helper functions to retrieve all calendars, collations, numberingSystems, and simple sanctioned units
And then use these helpers to replace hard-coded lists in other tests.
2021-09-08 09:29:06 -04:00
Michael Dyck 82e0487797 "Normalize" some YAML
In each case, it's the scalar value associated with the "description" key.
Normally in test262, this is written in either:
- block notation (indicated by '>' or '|'), or
- flow notation, single-line, on the same line as the key.

In the cases addressed by this PR, the value is instead written in:
- (1x) flow notation, *multi*-line, or
- (2x) flow notation, single-line, on the line *after* the key.

These are valid YAML, but they're styles that test262 doesn't otherwise use,
so could conceivably confuse people or harnesses.

This PR changes them to block notation.
2021-07-21 16:34:04 -04:00
jugglinmike 8faacdbaee
Add tests: "Extend TimeZoneName Option" proposal (#3042) 2021-07-16 09:45:02 -04:00
Kate Miháliková c27f6a5b9a
Add tests for Intl.DateTimeFormat conflicting options (#3033)
Relates to tc39/proposal-temporal#1590
2021-06-30 11:43:26 -04:00
Ujjwal Sharma f6034ebe9f Add DateTimeFormat tests for OrdinaryHasInstance
Add tests to make sure DateTimeFormat does not call the instanceof
operator and calls OrdinaryHasInstance instead.

Refs: https://github.com/tc39/ecma402/pull/500
2021-02-16 12:20:50 -05:00
ExE Boss 8f904d8cc8 Set function `length` and `name` in `CreateBuiltinFunction` 2021-01-29 09:45:20 -05:00
Yusuke Suzuki df1961f16a Fix formatRangeToParts/date-same-returns-single-date.js and add tests using practically-equal two dates
intl402/DateTimeFormat/prototype/formatRangeToParts/date-same-returns-single-date.js is using `formatRange` and `format`.
Fix this test to use `formatRangeToParts` and `formatToParts` since it is the intention of this test.

This patch adds additional tests to intl402/DateTimeFormat/prototype/formatRangeToParts/date-same-returns-single-date.js and
intl402/DateTimeFormat/prototype/formatRange/date-same-returns-single-date.js. The new test uses two dates that are practially-equal,
and ensures the implementation uses `format` or `formatToParts` by detecting they are practically-equal.
2021-01-10 20:55:08 -05:00
Felipe Balbontín 6cf3433cf8 Update copyright in formatRange/date-same-returns-single-date.js and formatRangeToParts/date-same-returns-single-date.js 2021-01-03 19:52:18 -05:00
Felipe Balbontín 22cdb74659 Add tests for Intl.DateTimeFormat formatRange(ToParts) to check the behavior when startDate is the same as endDate (tc39/proposal-intl-DateTimeFormat-formatRange#19). 2021-01-03 19:52:18 -05:00
Felipe Balbontín c898b68ef6 Update the description of some Intl.DateTimeFormat formatRange(ToParts) tests based on changes introduced in tc39/proposal-intl-DateTimeFormat-formatRange#23 2020-12-10 09:17:00 -05:00
Rick Waldron 82f38efbab Features: add "intl-normative-optional" 2020-11-03 14:28:17 -05:00
Yusuke Suzuki 20b11bee0f Add tests for [[Description]] of Intl [[FallbackSymbol]]
If normative optional is implemented and [[FallbackSymbol]] is used, its description should be "IntlLegacyConstructedSymbol"
2020-11-02 12:34:09 -05:00
Yusuke Suzuki 333da4198a Connector of date and time style can be " at " or ", "
macOS system ICU is shipping new CLDR, but it has many overrides on the top of it to make the formatted output suitable for the system.
And in timedatestyle-en.js tests, we intentionally override the CLDR data with the different format.
This change modifies the test to accept that alternative output.
2020-09-19 15:35:45 -04:00
Rick Waldron 873a7241c3 Fixup Intl.* this-value tests (delete dups, add proper esid) 2020-09-14 13:35:13 -04:00
Frank Tang ab3a86d9b3 Move tests from
https://source.chromium.org/chromium/chromium/src/+/master:v8/test/test262/local-tests/
2020-09-14 13:35:13 -04:00
Yusuke Suzuki 8060bba447 Accessing order of fractionalSecondDigits should be earlier than timeZoneName
In this PR[1], fractionalSecondDigits is listed earlier than timeZoneName in table 6[2].
So, accessing order of fractionalSecondDigits in [3]'s step-29 should be earlier than timeZoneName.

[1]: https://github.com/tc39/ecma402/pull/347
[2]: https://tc39.es/ecma402/#sec-datetimeformat-abstracts
[3]: https://tc39.es/ecma402/#sec-initializedatetimeformat
2020-09-02 15:30:46 -04:00
Yusuke Suzuki f6a9847c73
related-year-zh.js may not contain years (#2718)
macOS system ICU is shipping new CLDR, but it has many overrides on the top of it to make the formatted output suitable for the system.
And in related-year-zh.js tests, we intentionally override the CLDR data with the different format.
This change modifies the test to accept that alternative output.
2020-07-29 14:58:32 -07:00
Frank Yung-Fong Tang 59f5b49359 remove 0 from the range and use undefined 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang 1161eee3e4 use undefined instead of 0 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang 36e4278f20 use undefined instead of 0 so range is only 1-3 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang 21824359d0 restrict the range from 1 to 3 2020-07-09 21:52:54 -04:00
Frank Yung-Fong Tang e620226cd7 limit the range to 1 to 3 only 2020-07-09 21:52:54 -04:00
Yusuke Suzuki 281eb10b28
Intl.DateTimeFormat.{formatRange,formatRangeToParts} should throw TypeError instead of RangeError if either of parameter is undefined (#2685)
http://tc39.es/proposal-intl-DateTimeFormat-formatRange/
The spec draft throws TypeError instead of RangeError.

	1.4.5 Intl.DateTimeFormat.prototype.formatRange ( startDate , endDate )
	...
	4. If startDate is undefined or endDate is undefined, throw a TypeError exception.

	1.4.6 Intl.DateTimeFormat.prototype.formatRangeToParts ( startDate , endDate )
	...
	4. If startDate is undefined or endDate is undefined, throw a TypeError exception.
2020-07-01 14:45:43 -07:00
André Bargull d42aaa4b15 Expect `undefined` when no fractional second digits are present
Change the expected value per the current PR.
2020-06-24 12:11:36 -04:00
Frank Tang 8d3dd2d1a0 Sync the test w/ changes in intl-datetime-style 43
See
https://github.com/tc39/proposal-intl-datetime-style/pull/43
2020-06-17 12:44:31 -04:00
Alexey Shvayka ef12a8b11c
Intl: Add coverage for meaningful @@toStringTag values (#2634)
* Add Intl.Collator tests

* Add Intl.DateTimeFormat tests

* Adjust Intl.NumberFormat tests

* Add Intl.PluralRules tests

* Remove now duplicated tests

* Add "toString-changed-tag.js" tests
2020-06-01 15:40:35 -07:00
Frank Yung-Fong Tang 0942fe16ae correct comments 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 9b54c22e10 correct comments 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang aabf688371 correct comment 2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang e72a96572b Change the compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 21440c733c Change compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang fc55e45698 Change the compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 8ad12251ae Change compareArray to allow new property
Change the compareArray to code which allow new property but still assert the actual output contains the expected and assert the order.
2020-04-25 18:43:48 -04:00
Frank Yung-Fong Tang 4fb0e70db0 add "fractionalSecondDigits" 2020-04-25 18:43:48 -04:00