6084 Commits

Author SHA1 Message Date
Jordan Harband
408ecd0987 ArrayBuffer.prototype.detached tests
See https://tc39.es/proposal-arraybuffer-transfer/
2023-02-08 12:21:03 +01:00
Romulo Cintra
780b7b806e Add test to approximately format 2023-02-07 17:14:06 -08:00
Timothy Flynn
f5e2214b30 Swap call order of NumberFormat's notation and roundingIncrement options
The order in which these options are read was changed in commit:
29acfc6c3f
2023-02-07 16:14:13 -08:00
Shu-yu Guo
d03f11a81b Fix ArrayBuffer#transfer tests to preserve maxByteLength 2023-02-07 16:00:02 +01:00
Philip Chimento
e7364ea7dc Temporal: Tests for upper limit on rounding increments
Previously in a few cases (calendar units in Duration) the value for the
roundingIncrement option had no upper limit, other than having to be
finite. These tests cover a normative change limiting it to 1e9.

Normative PR: https://github.com/tc39/proposal-temporal/pull/2480
2023-02-01 11:50:44 -08:00
Philip Chimento
8aeab83c98 Temporal: Adjustments to order-of-operations tests
The with() methods, as well as PlainYearMonth's since() and until(), were
adjusted to read the receiver's fields before the fields of any objects
provided as arguments. This change is observable, so affects several tests
that test the observed order of operations.

Normative PR: https://github.com/tc39/proposal-temporal/pull/2478
2023-02-01 10:32:07 -08: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
Philip Chimento
a157570ddc Regularize some of the "calendar-temporal-object" tests
I used a script to "unroll" some of the calls to
TemporalHelpers.checkToTemporalCalendarFastPath(), and rewrite it slightly
not to use a specific Calendar instance. This is in preparation for a
future refactor, but also allows testing the PlainTime path which was not
previously covered.

(I didn't unroll all the calls and remove the helper yet, because the
remaining calls have custom assertions that I haven't gotten the script to
work with yet. For the same reason, I didn't yet convert these to use the
test generation facility. These will follow in a future PR.)
2023-02-01 10:50:12 +01:00
Philip Chimento
374aac475d Regularize "calendar-case-insensitive" tests
For each entry point where a string calendar name is accepted, we should
have a test that ensures the calendar name is case-insensitive. These
tests existed but several were incomplete as they didn't take nested
properties into account, and several entry points were missing this test.

Fix a minor copy-paste issue with double semicolons.
2023-02-01 10:50:12 +01:00
Richard Gibson
8700c92095 Temporal: Remove subsumed intl402 custom Calendar/TimeZone tests 2023-01-31 17:17:28 -08:00
Richard Gibson
ea10ca0cc6 Temporal: Add intl402 custom Calendar/TimeZone tests to cover rejection of invalid output 2023-01-31 17:17:28 -08:00
Richard Gibson
f9a62a4eb1 Temporal: Update custom Calendar/TimeZone tests to cover rejection of invalid output
Ref https://github.com/tc39/proposal-temporal/issues/2443
2023-01-31 17:17:28 -08:00
Richard Gibson
703873e1ca Test Array.prototype.findLast* length clamping 2023-01-30 15:32:14 +01:00
Shu-yu Guo
ad034f3230 Update ArrayBuffer transfer feature flag 2023-01-25 14:10:04 -08:00
Shu-yu Guo
59d5a6906d Update ArrayBuffer transfer tests for preserving resizability
The new proposal's semantics preserves resizability instead of always
returning a fixed length ArrayBuffer.
2023-01-25 14:10:04 -08:00
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