6209 Commits

Author SHA1 Message Date
Cam Tenny
eb44f67274 asyncHelpers tests: Address code review feedback 2023-02-21 11:04:09 -08:00
Cam Tenny
e0d5b780e7 Update CONTRIBUTING.md to suggest using asyncHelpers 2023-02-21 11:04:09 -08:00
Cam Tenny
4fe158d39d Generated tests for refactoring (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Cam Tenny
4d9d5c570d Refactor simple cases of (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Cam Tenny
1d116b48a9 harness/asyncHelpers.js: Refactor asyncTest to always return undefined instead of a Promise 2023-02-21 11:04:09 -08:00
Cam Tenny
d810c684ae harness/asyncHelpers.js: Refactor assert.throwsAsync to only accept a callable 2023-02-21 11:04:09 -08:00
Cam Tenny
4bd0545b29 harness/asyncHelpers.js: Remove dependency on Promise. 2023-02-21 11:04:09 -08:00
Cam Tenny
98952c3c51 harness/asyncHelpers.js: Refactor assert.throwsAsync to be async function 2023-02-21 11:04:09 -08:00
Cam Tenny
0294bea997 Harness tests for asyncHelpers.js' assert.throwsAsync function 2023-02-21 11:04:09 -08:00
Cam Tenny
cb9b45ded2 Harness tests for asyncHelpers.js' asyncTest function 2023-02-21 11:04:09 -08:00
Cam Tenny
c056d31b9b Adds harness/asyncHelpers.js: functions asyncTest and assert.throwsAsync, per rfcs/async-helpers.md 2023-02-21 11:04:09 -08:00
Philip Chimento
76a14bf659 Temporal: Tests for reference ISO dates
Tests for the process of calculating the reference ISO day for
Temporal.PlainYearMonth and the reference ISO year for
Temporal.PlainMonthDay.

Normative PR: https://github.com/tc39/proposal-temporal/pull/2475
2023-02-17 09:56:13 +01:00
Philip Chimento
a29788dd5d Temporal: Tests for calendar-specific mergeFields
In https://github.com/tc39/proposal-temporal/pull/2474, which achieved
consensus at the TC39 plenary meeting of 2023-01-31, the implementation-
defined steps for Temporal.Calendar.prototype.mergeFields had their
language tightened, to better specify what implementations must do.

This adds tests covering the new spec language, and moves one related test
out of staging.
2023-02-16 12:00:30 -08:00
Philip Chimento
6d7925a2d2 fixup: Changes based on 1st RFC experience 2023-02-15 09:21:07 -08:00
Philip Chimento
44c5e632fd RFC process documentation
This is a process allowing contributors to submit well-motivated
proposals to improve test262 using an RFC (Request For Commments)
process which is adapted from a similar process in the Rust community.
2023-02-15 09:21:07 -08:00
Mike Pennisi
62df2cadef Correct typos 2023-02-15 09:04:26 -08:00
Ms2ger
ac098dbe6a Apply suggestions from code review
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2023-02-15 09:04:26 -08:00
Mike Pennisi
97477ad1f6 fixup! Document rationale for some maintenance practices 2023-02-15 09:04:26 -08:00
Mike Pennisi
f59823860e fixup! Document rationale for some maintenance practices 2023-02-15 09:04:26 -08:00
Mike Pennisi
17238ca018 fixup! Document rationale for some maintenance practices
Integrate some review feedback
2023-02-15 09:04:26 -08:00
Mike Pennisi
7e190c786d Document rationale for some maintenance practices 2023-02-15 09:04:26 -08:00
Philip Chimento
8ad7d04afa Temporal: Test copying options object in since() and until()
In since() and until() methods, we copy the options object with
CopyDataProperties. Previously, its properties could be read in more than
one place (the method itself, and the calendar method), triggering user
code each time. Now, we pass around null-prototype objects with only data
properties.

See https://github.com/tc39/proposal-temporal/pull/2447
2023-02-14 09:45:43 -08:00
Aditi
1c47728a20 Remove failing tests for CalendarFields and CalendarMergeFields 2023-02-10 17:43:47 -08:00
Romulo Cintra
b17b9411e0 Update DurationFormat and FormatToParts tests
https://github.com/tc39/proposal-intl-duration-format/pull/126
2023-02-08 10:53:17 -08:00
James Wright
01425696e6 Push into calls array in calendar and timeZone observers. 2023-02-08 12:29:24 +01:00
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