Commit Graph

6069 Commits

Author SHA1 Message Date
Philip Chimento ac1c3546c3 Fix argument in example calls to assert.throwsAsync()
Thanks Ashley!
2023-01-20 10:25:54 -08:00
Cam 7f3558376d Fix typo in rfcs/async-helpers.md
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2023-01-20 10:25:54 -08:00
Cam Tenny edd1e6d25f Update rfcs/async-helpers to reflect the pre-final comment consensus API for asyncTest and assert.throwsAsync 2023-01-20 10:25:54 -08:00
Philip Chimento a776c8a948 Resolve → Fulfill
Using the correct terminology here.
2023-01-20 10:25:54 -08:00
Philip Chimento 29fbe30eda Fix mistake in dynamic import test example
I overlooked the fact that passing an imported module object to $DONE will
correctly fail the test.

I still think this way of writing the test is unclear, though.
2023-01-20 10:25:54 -08:00
Philip Chimento d9dd1e8d03 Add pull request link 2023-01-20 10:25:54 -08:00
Philip Chimento 1f0702b72a RFC: Async Helpers
This proposes a `harness/asyncHelpers.js` file with two helpers in it,
`asyncTest()` and `assert.throwsAsync()`. See the RFC for further
motivation and details.

Note the draft RFC process in https://github.com/tc39/test262/pull/3525.
My idea for this pull request is that besides being an RFC in its own
right, we use it as a test case for the process. That is, we follow the
draft RFC process and hopefully either validate it, or surface changes
that need to be made, after which we can land the RFC process in our
documentation.
2023-01-20 10:25:54 -08: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
Aditi e1048d0aff Update Temporal test262 as per the normative changes 2023-01-04 10:56:25 -08:00
Cam Tenny 09f863d8c3 Temporal operation NanosecondsToDays: Test infinite or arbitrary-length observable loops in Duration and ZonedDateTime 2023-01-03 12:47:37 -08:00
Ms2ger 6fcebf2f85 Improve NumberFormat and DateTimeFormat tests for OrdinaryHasInstance 2023-01-03 12:40:48 -08:00
Huáng Jùnliàng 58b3321dba remove invalid element decorator yield reference tests 2023-01-03 12:33:04 -08:00
Cam Tenny f00d4118db Temporal operation NanosecondsToDays: Test RangeErrors reachable in Duration and ZonedDateTime. 2022-12-23 15:35:51 +01:00
Ms2ger 920a567b72 Improve is/toWellFormedString coverage. 2022-12-21 10:57:19 +01:00
snek 06b982d2f0 add missing feature to cleanupSome test 2022-12-19 10:04:34 +01:00
Justin Grant 9f6da57ee4 Support running Temporal staging tests in Node 19
Adapt to the following changes in CLDR 42 in Node 19:
- Some spaces in formats replaced by other whitespace unicode characters
- German format changes, which may be bugs (see
  https://unicode-org.atlassian.net/browse/CLDR-16243)

This commit makes affected tests more resilient to Intl.DTF output
changes between Node versions.

A good idea for a future PR would be to change these tests to rely less
on CLDR formats while still testing that Temporal and Intl are behaving
as expected.
2022-12-17 23:52:37 -05:00
Justin Grant 12ff866707 Replace "de"=>"de-AT" and "en"=>"en-US"
Make locales consistent throughout these tests, and splitting into a
separate commit to make it easier to review substantial changes later.
2022-12-17 23:52:37 -05:00
Justin Grant f999dea7c0 Run prettier for easier review of later commits 2022-12-17 23:52:37 -05:00
Philip Chimento 9821def022 Add missing feature flag to isContructor helper file
The linter says this should include the Reflect.construct feature flag.
2022-12-17 13:18:46 -08:00
Philip Chimento 7c9a885b79 Array.fromAsync: Boilerplate tests
Here are some of the standard tests for property metadata of the
Array.fromAsync property and for the built-in function object. These don't
require doing anything asynchronously, so can be considered separately
from the Async Helpers RFC.
2022-12-17 13:18:46 -08:00
jugglinmike 5093c3037d
Reject exceptional input to `isConstructor` (#3748)
* Reject exceptional input to `isConstructor`

Prior to this commit, the `isConstructor` harness function would return
`false` when invoked with a value that lacked a [[Call]] internal
method. While it's true that such values are not constructors, there are
no tests which benefit from using `isConstructor` to make such an
assertion.

Extend `isConstructor` to throw an error when invoked with a
non-function object. Update a test which was misleadingly invoking the
function with the value `undefined`.

* fixup! Reject exceptional input to `isConstructor`
2022-12-15 22:53:34 -05:00
Frank Yung-Fong Tang dac6956348
sync with duration-format PR130 (#3752)
https://github.com/tc39/proposal-intl-duration-format/pull/130
2022-12-14 16:08:52 +01:00
Timothy Flynn e6c6460a5b Update Intl.NumberFormat test with recent reorder of option evaluation
The order of evaluation for "notation" and "roundingIncrement" changed
in https://github.com/tc39/proposal-intl-numberformat-v3/commit/a260aa3.
2022-12-12 12:15:53 +01:00
Justin Grant d8bc356d01 Fix Temporal test failures under Node 19 2022-12-10 11:33:20 -05:00
Richard Gibson 8cd563f978
Intl: Add substantive tests for Array.prototype.toLocaleString (#3741) 2022-12-05 10:51:55 +01:00
Richard Gibson 3d939ef566
Fix typo in CONTRIBUTING.md (#3743) 2022-12-02 13:23:29 -05:00
Richard Gibson 421764fbac
Update test case style to match current patterns (#3742) 2022-12-02 12:53:49 -05:00
Philip Chimento 8f752acdaa Temporal: Test order of property accesses
This contains tests for the normative PR
https://github.com/tc39/proposal-temporal/pull/2437, which is to be
presented for consensus to TC39 in the upcoming plenary meeting. That PR
changes the observable order of property accesses to be alphabetical where
possible.
2022-12-01 11:35:04 -08:00
Timothy Flynn f1fc5c6497 Fix typos in String.prototype.isWellFormed/String.prototype.toWellFormed
1. String.prototype.toWellFormed's name is "toWellFormed".

2. "asserts" does not exist in the test harness, and "assert.throws"
   expects the error type first.
2022-12-01 17:02:41 +01:00
Jordan Harband 30a5b38f23 `String.prototype.isWellFormed`/`String.prototype.toWellFormed`: add tests 2022-12-01 16:04:31 +01:00
Philip Chimento 3ed92d7a33 Bump esvu version
This should bring in the fix that actually lets GraalJS install.
2022-12-01 15:16:40 +01:00
Philip Chimento 7ee321e76a Temporal: Reconcile yearOfWeek tests with changes to YYYY-MM-DD+UU format
This reconciles changes made in two normative PRs to the Temporal proposal
which each had their own separate PRs for tests. The yearOfWeek tests were
written before the changes to the ISO 8601 grammar which disallowed the
YYYY-MM-DD+UU format. This brings the yearOfWeek tests in line with the
tests for the other calendar methods.
2022-12-01 15:07:47 +01:00
Philip Chimento e7895c53d2 Rebuild generated tests
This adds new tests because the tests that previously had name conflicts
are now renamed.
2022-11-30 16:04:02 -08:00
Philip Chimento db39fee915 Fix name conflict in path of decorators test template
This test template shared the same "path" as its sibling,
cls-decl-decorators-valid-syntax.template. That meant that these two
templates would race to generate the same test files with different
contents.

This prefixes the generated tests for class element decorators (as opposed
to class decorators) with "class-element-".
2022-11-30 16:04:02 -08:00
Philip Chimento cc559ac106 Rebuild generated tests 2022-11-30 16:04:02 -08:00
Philip Chimento 1d5e560ca7 Fix typo 2022-11-30 16:04:02 -08:00
Philip Chimento d87a7da6e1 Replace Object.hasOwnProperty.call with Object.prototype.hasOwnProperty.call
While we're at it, use assert() instead of assert.sameValue() for brevity,
if we are not specifically testing that the return value of hasOwnProperty
is the value true or false; and add more informative assertion messages to
help with debugging.

In some cases, the Object.hasOwnProperty.call could be replaced with
verifyProperty(), if the property descriptor was also being verified at
the same time.

This fixes some tests that were faulty to begin with: a common mistake was
Object.hasOwnProperty(obj, prop) which is probably going to return false
when that's not what you want.

The only instances left of `Object.hasOwnProperty` are one regression test
in implementation-contributed which I can't tell if it was intentionally
needed to trigger the regression, and a few instances of
`Object.hasOwnProperty('prototype')` which would defeat the purpose to
convert into `Object.prototype.hasOwnProperty.call(Object, 'prototype')`
form.

Closes: #3524
2022-11-30 16:04:02 -08:00
snek 8609067d0c re-enable graaljs 2022-11-30 10:48:44 -08:00
Philip Chimento 6e4f412d65 Temporal: Tests for normative changes around date-only strings
As per the discussion in
https://github.com/tc39/proposal-temporal/issues/2379#issuecomment-1248557100
and the PR https://github.com/tc39/proposal-temporal/pull/2398, which is
to be presented for consensus to TC39 in the upcoming plenary meeting, UTC
offsets and the Z designator should be disallowed after any date-only
strings (YYYY-MM-DD, YYYY-MM, and MM-DD). They should only be allowed to
follow a time component. Z remains disallowed in any string being parsed
into a Plain type.

Annotations become allowed after any ISO string, even YYYY-MM and MM-DD
where they were previously disallowed.
2022-11-30 10:11:10 -08:00
Philip Chimento 3775b4774b Temporal: Add tests for new yearOfWeek API
To be presented for consensus in the November/December TC39 meeting. This
adds tests for a 'yearOfWeek' getter to PlainDate, PlainDateTime, and
ZonedDateTime, for use alongside 'weekOfYear', and tests for a
corresponding method to Calendar.

The tests are basically the existing tests of 'weekOfYear' adapted.

Temporal issue: https://github.com/tc39/proposal-temporal/issues/2405
2022-11-30 10:06:53 -08:00
Philip Chimento 338063f80f Temporal: Test throwing on time-zone-to-calendar conversion and vice versa
This contains tests for the normative PR
https://github.com/tc39/proposal-temporal/pull/2433, which is to be
presented for consensus to TC39 in the upcoming plenary meeting. That PR
changes ToTemporalCalendar to throw when it encounters a Temporal.TimeZone
instance, and ToTemporalTimeZone to throw when it encounters a
Temporal.Calendar instance.
2022-11-30 10:01:45 -08:00
Philip Chimento 9b5c38d109
Remove Python 2 CI job (#3727)
The Python 2 and 3 jobs run essentially the same thing twice. I asked for
a sign from implementations if any of them were relying on Python 2 for
their test262 runners, but didn't hear of any that were.

The Python tools are changed so rarely that I think it's OK to drop this
CI job. If a future change breaks Python 2 for someone, we can accept PRs
to fix it on a best-effort basis, or reinstate this CI job if it's really
necessary.

Closes: #3480

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2022-11-30 16:43:23 +01:00
Philip Chimento 39302ea3c1 Temporal: Add test for Calendar.id with custom calendar
We already have a similar test covering TimeZone.id that ensures toString
is not called. We did not have this coverage yet for Calendar.id, so adapt
the TimeZone test for Calendar.
2022-11-29 10:57:10 -08:00
Philip Chimento 0fc42035eb Temporal: Update tests to use internal slot in TimeZone and Calendar.id
In https://github.com/tc39/proposal-temporal/pull/2411, to be proposed for
consensus in TC39 in December, the .id getter of TimeZone and Calendar
should no longer call toString().
2022-11-29 10:57:10 -08:00
André Bargull 7988e3eb65 Update expected results for CLDR 42 2022-11-29 11:59:25 +01:00
Philip Chimento 1e9dc7f38e Temporal: Clean up existing uses of foo.splice(0, foo.length)
The second parameter isn't needed if the intention is to empty the array.
Additionally clearing it at the end of the test isn't needed.
2022-11-29 11:53:40 +01:00
Philip Chimento 47b9e32dc3 Temporal: Add some more order-of-operations tests
This adds order-of-operations tests that cover all of the Temporal entry
points that accept options bags, that were not already covered. We'll be
using these tests in the future to verify
https://github.com/tc39/proposal-temporal/issues/2254
However, the tests in this commit reflect the current state of the
proposal, not the potential normative change.
2022-11-29 11:53:40 +01:00
Philip Chimento 5747285940 Temporal: Observe ToString of calendar property in Temporal.PlainTime.from
Similar to the previous commit, but with a toPrimitiveObserver instead of
a calendarObserver, which would cause PlainTime.from() to throw.
2022-11-29 11:53:40 +01:00
Philip Chimento f2e17efaf8 Temporal: Expand order-of-operations tests to cover calendar methods
Some of the existing order-of-operations tests didn't observe the calendar
operations. Add a TemporalHelpers.calendarObserver() calendar to the
invocations of these methods in the order-of-operations tests.
2022-11-29 11:53:40 +01:00