Commit Graph

6121 Commits

Author SHA1 Message Date
Frank Yung-Fong Tang 4569e73420
Fix DurationFormat default tests (#3640)
1. add the test for "seconds"
2. since the default value for "style" is "long", baseStyle for GetDurationUnitOptions is "long" and therefore the 
last argument in testOption should be "long"
3. the valid values for "days" does not contains  "numeric", and "2-digit". remove them. 
4. the valid values for "milliseconds", "microseconds" and "nanoseconds" does not contains "2-digit". remove it.

See https://tc39.es/proposal-intl-duration-format/#table-duration-components about the valid value
notice the last colum is for "Digital Default" while the baseStyle is "digital" but the set up does not set it that way, the default value for "style" is "long" as in
```
13. Let style be ? GetOption(options, "style", "string", « "long", "short", "narrow", "digital" », "long").
```
of https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat

* Sync to PR 121

Change default from "long" to "short"
2022-09-14 12:51:40 -07:00
Frank Yung-Fong Tang 03cff7fcba Remove undefined to sync to PR 113
undefined is no longer value output for resolvedOptions().fractionalDigits
2022-09-14 12:42:53 -07:00
Jordan Harband 8f19bb4a45
Fix features in tests from #3354 and #3353 2022-09-14 11:30:22 -07:00
Justin Ridgewell 9592077530 Update groupToMap tests 2022-09-14 11:38:07 -07:00
polsevev ce511219e8 add tests for array.prototype.groupByToMap 2022-09-14 11:38:07 -07:00
Justin Ridgewell e7af14502e Test callback throwing 2022-09-14 11:02:48 -07:00
Justin Ridgewell 95f869ce0d Test non-property key throws 2022-09-14 11:02:48 -07:00
Justin Ridgewell 457185507e Add test for get access throwing 2022-09-14 11:02:48 -07:00
Justin Ridgewell 6cdb375d8c Add test for length conversion 2022-09-14 11:02:48 -07:00
Justin Ridgewell 22fe1b44b2 Update group tests 2022-09-14 11:02:48 -07:00
polsevev 5bd6844df5 added tests for groupBy 2022-09-14 11:02:48 -07:00
Philip Chimento 0bc0ca189d Temporal: Fix test that depends on pre-1970 time zone data
Due to the TZDB's recent merging of time zones whose pre-1970 data was
different but post-1970 have been the same, this test is going to start
failing on implementations with up-to-date time zone data (because the
Europe/Amsterdam time zone was absorbed into Europe/Brussels in the latest
update.)

It's on our to-do list to remove all dependencies on IANA time zones from
the Temporal tests in staging/,
(see https://github.com/tc39/test262/issues/3649#issuecomment-1232326175)
but this one is more urgent.
2022-09-14 18:06:40 +02:00
Philip Chimento e391176717 Apply suggestions from code review 2022-09-13 11:32:16 -07:00
Aditi c6b62110f9 Added intl tests for timezone and calendar case insensitivity 2022-09-13 11:32:16 -07:00
Aditi d7181a5866 Add timezone case insensitive tests 2022-09-13 11:32:16 -07:00
Aditi cf51de578f Add calendar case insensitive tests 2022-09-13 11:32:16 -07:00
Philip Chimento dc1dc28aa4 Add tests for proposal-resizable-arraybuffer to staging
These are tests for the Resizable ArrayBuffer proposal:
https://tc39.es/proposal-resizablearraybuffer/

These tests were automatically converted from V8's tests for the
proposal:
https://source.chromium.org/chromium/chromium/src/+/main:v8/test/mjsunit/typedarray-resizablearraybuffer.js
and subsequently edited by hand to fix things that couldn't be converted
automatically.
2022-09-08 11:49:06 -07:00
Kevin Gibbons 746197355c
Implement changes for "avoid mostly-redundant `await` in async `yield*`" (#3619) 2022-09-06 13:21:50 +02:00
Romulo Cintra f1870753fa Update Tests accoring with spec changes 2022-09-05 11:05:44 +02:00
Philip Chimento 051631f58b Temporal: Start moving collections of valid/invalid strings into TemporalHelpers
This adds an object, TemporalHelpers.ISO, which has methods that return
arrays of various ISO strings. The idea is to deduplicate more string
tests into methods on this object.
2022-08-31 08:59:33 -07:00
Philip Chimento ddef61a106 Temporal: Deduplicate strings-with-calendar from strings-without-calendar
The strings with calendar annotations in these tests don't need to be
listed separately, they can be derived from the original strings.
2022-08-31 08:59:33 -07:00
Philip Chimento 409d6dc71a Temporal: Add tests for PlainTime string disambiguation with calendar
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2287 which reached
consensus at the July 2022 TC39 meeting.

It adds tests that ensure that PlainTime strings which require a T
designator for disambiguation, are not disambiguated by adding a calendar
annotation.
2022-08-31 08:59:33 -07:00
Philip Chimento d8e8529e8d Temporal: Add tests for PlainTime string disambiguation with time zone
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2284 which reached
consensus at the July 2022 TC39 meeting.

It adds tests that ensure strings like HHMM-UU[TZ] and HHMMSS[TZ] do not
require a disambiguating T separator, even if HHMM-UU and HHMMSS would by
themselves.
2022-08-31 08:59:33 -07:00
Aditi 8dcc0e1955 Add calendar strings to instant string tests 2022-08-25 10:14:30 -07:00
Aditi 747bed2e8a Add intl in staging directory 2022-08-11 15:41:01 -07:00
Philip Chimento c4daf3ef74 Temporal: Add test for rounding Duration relative to Feb 1 in a leap year
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2344 which reached
consensus at the July 2022 TC39 meeting.

It adds a test that catches a corner case in Duration.prototype.round().
2022-08-11 12:57:37 -07:00
Kevin Gibbons adba7dfd9c fix order 2022-08-09 12:15:49 -07:00
Kevin Gibbons 418419a345 add non-matching example 2022-08-09 12:15:49 -07:00
Kevin Gibbons 52284ba4bb add tests for proposal-duplicate-named-capturing-groups 2022-08-09 12:15:49 -07:00
Kevin Gibbons b42d184876 update descriptions for existing duplicate-capture-groups tests 2022-08-09 12:15:49 -07:00
Philip Chimento d45766bef3 Add cases to RegExp.prototype flags brand checking tests
For completeness, as we are doing in newer brand checking tests such as
those of Temporal, call these getters with a function object and a bigint
as the receiver.

Suggested in https://github.com/tc39/test262/pull/3614/files#r929662337
2022-08-09 12:07:36 -07:00
Richard Gibson 9e51a9d855 Update RegExp.prototype.{match,replace} tests to expect Get(rx, "flags")
Ref https://github.com/tc39/ecma262/pull/2791
2022-08-09 12:02:45 -07:00
Richard Gibson 29c36b0561 Meta: Link to engine262 instructions 2022-08-09 11:55:18 -07:00
Aditi 6a99a28dd8 Add proposal-temporal's old demitasse tests to staging 2022-08-09 11:44:54 -07:00
Jordan Harband 8c64a666e1
Meta: fix codeowners syntax 2022-08-04 16:28:45 -07:00
Ms2ger 66ecafff2b Add proposal-temporal's Temporal.Instant tests to staging
Now that we have a staging directory, we can add the old-style tests from
proposal-temporal and avoid having to sync PRs across two repositories
when we convert them to test262 style.

Ms2ger wrote a script to convert them to be executable with the test262
harness, and this is the result of running that script on the remaining
Temporal.Instant tests in proposal-temporal.

More tests of other Temporal types to follow.
2022-08-04 16:20:26 -07:00
Jordan Harband 033b79fde0 Meta: add CODEOWNERS
This requires @tc39/test262-maintainers approval for everything, but also allows @tc39/test262-staging approval for the `test/staging` directory.
2022-08-04 11:47:38 -07:00
Linus Groh 0f35848794 ShadowRealm: Relax requirements of globalThis available properties test
The intention of this test is to ensure that all built-in properties of
the global object are also exposed on the ShadowRealm's global object,
without penalizing implementations that don't have all of them
implemented.
Notably, SharedArrayBuffer may still not be (re-)enabled in all
circumstances.
2022-08-04 20:37:23 +02:00
Aditi e9f424b6fc Remove duplicate timezone tests 2022-08-04 11:03:46 +02:00
Yusuke Suzuki f74cee5f59 Rename Array#groupBy and Array#groupByToMap to Array#group and Array#groupToMap
TC39 decided to rename them to avoid web-compat issue[1].
This change follows to it.

[1]: https://github.com/tc39/proposal-array-grouping/pull/39
2022-08-03 13:29:11 -07:00
Philip Chimento 10a5c4f784 Temporal: Adjust and expand tests for observable calls to ToString(calendar)
This implements the normative change in
https://github.com/tc39/proposal-temporal/pull/2269 which reached
consensus at the July 2022 TC39 meeting.

There was already a test for PlainDate for this topic, which needs to be
adjusted to accommodate the normative change. Tests for PlainDateTime and
ZonedDateTime did not yet exist, so add new ones based on the PlainDate
test.
2022-08-03 14:23:40 +02:00
Philip Chimento 1587af3936 CI: Bump esvu to 1.2.9
1.2.8 does not install graaljs correctly.
2022-08-03 14:23:04 +02:00
Kevin Gibbons 4c0322569c add tests for "only coerce once in BigInt constructor" 2022-08-02 18:17:20 -07:00
André Bargull d7a10658d9 Replace time zone link name canonicalisation tests
Replace tests with more simple tests that only ensure link names are
accepted.
2022-08-01 14:13:30 -07:00
André Bargull 5d3d39ee16 Remove tests which use negative day lengths
There are already tests to reject negative day lengths, so we can simply
remove these other tests.

Also remove a misleading comment ("Test negative divisor"), because the
test following the comment actually uses a positive divisor.
2022-08-01 14:13:30 -07:00
André Bargull 30091032c1 Import SpiderMonkey Temporal tests
Temporal tests written for the SpiderMonkey implementation. Mostly
covers edge cases around mathematical operations and regression tests
for reported spec bugs.
2022-08-01 14:13:30 -07:00
Philip Chimento 6685c6c81c Temporal: Add tests for casting a calendar ID string to a Temporal.Calendar
This adds tests to every entry point where a Temporal.Calendar is
accepted, making sure that a calendar ID string is also accepted.
2022-08-01 13:48:11 -07:00
Philip Chimento bc0e006de4 Temporal: Add tests for casting a time zone ID string to a Temporal.TimeZone
This adds tests to every entry point where a Temporal.TimeZone is
accepted, making sure that a time zone ID string is also accepted.
2022-08-01 13:48:11 -07:00
Philip Chimento 7d31aa21ad Temporal: Add basic IANA-time-zone-aware tests for TimeZone.getPlainDateTimeFor
This adds several tests for values that should be produced by the time
zone database and should not be subject to change in the future. This
tests basic functionality of TimeZone.getPlainDateTimeFor with an IANA
time zone database.
2022-08-01 13:48:11 -07:00
Philip Chimento 6b5297a142 Temporal: Add tests for invalid strings as values of 'offset' property
(...in property bags; the 'offset' option in an options object already has
tests)
2022-08-01 13:48:11 -07:00