Commit Graph

343 Commits

Author SHA1 Message Date
José Julián Espina dde3050bdb
Fix test regression in asyncHelpers.js (#4197) 2024-08-19 12:33:17 -04:00
Linus Groh 984df1f3db Remove unused harness/timer.js 2024-08-14 08:37:46 -07:00
Richard Gibson feb400c685 harness/asyncHelpers.js: Update throwsAsync to not succeed on a bad thenable
Fixes #4186
2024-08-02 08:52:05 +02:00
Richard Gibson f83c1b9387 harness/asyncHelpers.js: Further reduce the size of assert.throwsAsync 2024-08-01 12:10:32 -04:00
Richard Gibson fa3d0246e7 harness/asyncHelpers.js: Reduce the size of assert.throwsAsync 2024-08-01 11:42:34 -04:00
Richard Gibson 0b61e98564 harness/asyncHelpers.js: Clean up assert.throwsAsync failure messages
* Remove mention of an "inner" promise/thenable.
2024-08-01 11:41:25 -04:00
Richard Gibson b87eaf9ac3 harness/asyncHelpers.js: Fix an assert.throwsAsync failure message typo 2024-08-01 11:39:10 -04:00
Richard Gibson 0631e2111b harness/asyncHelpers.js: Isolate assert.throwsAsync failure conditions 2024-08-01 11:38:06 -04:00
Richard Gibson b22b500f24 harness/asyncHelpers.js: Refactor assert.throwsAsync to fail fast 2024-08-01 11:38:06 -04:00
Richard Gibson 1b34a1c484 harness/asyncHelpers.js: Add doc comments 2024-08-01 11:38:06 -04:00
Philip Chimento 3b89be9c5d Temporal: Fix Japanese era test
This mistakenly used a previous name for the helper function. Also adds
a couple of debugging messages.
2024-07-29 14:17:24 +02:00
Paul Bakker e7d9c0d698 Follow-up to #4165
Added catch to achieve the entire goal of the previous PR to prevent the
harness from loading if 'class' syntax isn't supported
2024-07-25 09:29:40 -07:00
Paul Bakker 79df6ec2e1 Make resizableArrayBufferUtils not depend on syntax that may not be
supported
2024-07-24 12:52:18 -07:00
Paul Bakker b6c2f55954 Remove unneeded /u flag within harness/nativeFunctionMatcher 2024-07-24 10:46:30 -07:00
Philip Chimento 50b023e6c9
Fix syntax error from #4164 (#4167)
* Fix syntax error from #4164

Function statements require a name.

See #4166

* Apply suggestions from code review

Co-authored-by: Jordan Harband <ljharb@gmail.com>

---------

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-07-24 10:29:51 -07:00
Paul Bakker f55e99796f
Prevent harness code not loading when async/generator/asyncGenerator not supported (#4164)
* Dont throw when async/generato/asyncGenerator not supported

* Apply suggestions from code review
2024-07-24 09:18:02 -07:00
Paul Bakker 0a8622de68 Dont use const in for (of) loops, for when those aren't properly
supported
2024-07-23 15:40:13 -07:00
André Bargull 16322d384a Allow alternative era names
Temporal doesn't specify concrete era names, so tests shouldn't assert
for example that the era code of the current Gregorian era is `"ce"`. We
still want to validate the era names somehow however, so allow alternative
era names using the era codes from the "Intl era and monthCode" proposal.
2024-07-10 07:59:20 -07:00
Philip Chimento efc7424844 Temporal: Don't use getISOFields() in other tests
Previously getISOFields() was used to get the exact value of the
[[Calendar]] and [[TimeZone]] internal slots, as well as to get the
reference ISO year for PlainMonthDay and reference ISO day for
PlainYearMonth.

Use calendarId and timeZoneId for the former and toString() for the
latter.
2024-07-05 10:43:53 +02:00
Philip Chimento 9671c4a613 Temporal: Test adjustments for removing calendar and time zone objects 2024-07-05 10:43:53 +02:00
Philip Chimento 5cd7e9077d Temporal: Remove calendar and time zone observers
These are no longer possible without custom objects. Also add an exception
for calendar and timeZone properties in property bag observers so they are
not treated as objects.
2024-07-05 10:43:53 +02:00
Philip Chimento 27bc974287 Temporal: Replace TemporalHelpers.specificOffsetTimeZone with offset strings 2024-07-05 10:43:53 +02:00
Philip Chimento 0a1cb1307f Temporal: Edit test descriptions that refer to Calendar and TimeZone objects 2024-07-05 10:43:53 +02:00
Philip Chimento 372527e572 Temporal: Don't pass custom calendar in helper tests
This is no longer necessary if there are no calendar objects.
2024-07-05 10:43:53 +02:00
Philip Chimento debd22a2ad Temporal: Remove tests that throw on calendar or time zone method accesses
Many tests tested some functionality while asserting that there were no
calls of calendar or time zone methods. We can continue testing the
functionality, but there are no more methods to call, so we can delete
those parts of the tests.
2024-07-05 10:43:53 +02:00
Philip Chimento 7d970fbe4e Temporal: Remove fake West Coast and Samoa time zones from TemporalHelpers
It's no longer possible to fake built-in time zones using custom objects.
So testing DST shifts will have to use real built-in time zones. Replace
TemporalHelpers.springForwardFallBackTimeZone with America/Vancouver (it
was modelled on the DST transitions in 2000) and
TemporalHelpers.crossDateLineTimeZone with Pacific/Apia (it was modelled
on the 2011 switch to the other side of the international date line.)

These tests have to move to the intl402/ folder since non-Intl-aware
implementations are allowed (but not required) to support any built-in
time zones other than UTC.
2024-07-05 10:43:53 +02:00
Philip Chimento c728e6d89e Temporal: Fix tests that unnecessarily create TimeZone or Calendar instances
In many cases we created a TimeZone or Calendar instance from a built-in
time zone or calendar. These tests can be trivially adapted to just use
the string ID.
2024-07-05 10:43:53 +02:00
Linus Groh a82f5382ff Remove 'AsyncArrowFunction' test
There is no such hidden constructor, it's the same as the hidden
AsyncFunction constructor. In other words:

```js
Object.getPrototypeOf(async () => {}).constructor ===
Object.getPrototypeOf(async function () {}).constructor
```

Also add a test to ensure that %AsyncFunction.prototype% is indeed the
prototype of an async arrow function.

Closes #4044.
2024-07-04 11:03:23 +02:00
Philip Chimento 6626b60df6 Temporal: Make U+2212 MINUS SIGN invalid in ISO strings
These are the test adjustments corresponding to the normative PR
https://github.com/tc39/ecma262/pull/3334 which reached consensus at the
June 2024 TC39 meeting.
2024-07-03 08:50:57 -07:00
Jordan Harband 5217ef396e
throwsAsync, `Promise.try`: avoid unneeded syntax
Followup to #4086
2024-05-17 09:13:21 -07:00
Ioanna M Dimitriou H c95cc6873d
Collection of helper constants and functions for testing RABs (#4030)
Collection of helper constants and functions for testing resizable array buffers.

These are the parts of the code in RAB staging tests that are heavily repeated.
In order to somewhat compact the migration of RAB staging tests (see PR #3888).
2024-04-30 11:10:19 -07:00
André Bargull 330ecdd016 Sync partitionDurationFormatPattern with latest spec draft
Sync `partitionDurationFormatPattern` with the latest spec draft and
change it to use an `Intl.DurationFormat` object as the input, so it's
easier to compare it against the spec text and because it allows to test
more inputs.

Includes the fixes for:
- https://github.com/tc39/proposal-intl-duration-format/pull/183
- https://github.com/tc39/proposal-intl-duration-format/pull/184
2024-04-23 18:27:01 +02:00
Philip Chimento 0c12b84244 Temporal: Add tests for incorrectly capitalized annotation keys
As per IETF, annotation keys may only consist of lowercase letters,
dashes, and digits, and an optional leading underscore. Uppercase letters
are non-syntactical. Add tests covering this.
2024-04-03 12:32:46 +02:00
Kevin Gibbons c1d09be840 add more cases for float16 coercions 2024-03-25 15:22:57 -07:00
Philip Chimento 97a2e443e1 Temporal Helpers: Remove unused variable
We stored Temporal.PlainDateTime.compare in a variable for convenience but
then used Temporal.PlainDate.compare instead. The variable was actually
intended to be used here. No change in functionality.
2024-01-22 11:42:59 -08:00
Philip Chimento c877132488 Temporal Helpers: Better formatting for assertion messages
Adding colons in the appropriate places will make assertion failures
easier to understand.
2024-01-22 11:42:59 -08:00
Kevin Gibbons 4087779220 add Float16 to byteConversionValues 2024-01-22 17:39:31 +01:00
Kevin Gibbons 9c4e0fd902
introduce nonClampedIntArrayConstructors (#3984) 2024-01-11 11:35:28 +01:00
Kevin Gibbons 67a5153cf5
add Float16Array to all generic TypedArray tests (#3849) 2024-01-10 14:07:57 +01:00
Philip Chimento 50abc12d97 Temporal: Remove BigInt arithmetic and loops in UnbalanceDurationRelative 2023-11-16 11:08:42 -08:00
Philip Chimento dab8ccc5df Temporal: Add more coverage for non-ISO PlainMonthDay underspecification
Built-in non-ISO calendars require either monthCode/day, or month/day plus
some form of year specification.

This adds test coverage for each of the categories listed in
https://github.com/tc39/proposal-temporal/issues/2664, of which some must
currently reside in the test/intl402/ folders.
2023-10-26 12:37:43 -04:00
Philip Chimento 8bc3dbb234 Temporal: Move non-ISO calendar tests to intl402/
We'll do this for now, then separately work on migrating all of the tests
that require a non-ISO8601 calendar but aren't dependent on it being any
particular calendar.
2023-10-26 12:37:43 -04:00
Richard Gibson 5c629683f2 Temporal: Update PlainMonthDay-related tests
As of https://github.com/tc39/proposal-temporal/pull/2500 ,
year is always optional for the ISO 8601 calendar.
2023-10-26 12:37:43 -04:00
André Bargull 9f5938bc15 Fix harness tests for verifyProperty 2023-10-02 11:27:59 +02:00
André Bargull 534decc36d Fix typos in calls to verifyProperty
And update verifyProperty to catch misspelled descriptor fields.
2023-09-13 16:05:40 +02:00
André Bargull b4f72feb52 Verify object value in addition to descriptor value in verifyProperty 2023-09-13 16:05:40 +02:00
Philip Chimento f44bbe4035 Temporal: Avoid calling user code in no-op round operations
This shortcut path now exists in all round(), since(), and until()
operations.
In Instant, PlainDate, PlainDateTime, and PlainTime, the change isn't
observable, so no tests could be added. This adds test coverage for

- Duration.p.round()
- PlainYearMonth.p.since()
- PlainYearMonth.p.until()
- ZonedDateTime.p.round()
- ZonedDateTime.p.since()
- ZonedDateTime.p.until()

As well as a few cases where we are testing that certain calendar methods
get called during a round operation, but previously were doing so with
options that now become a no-op and no longer call those calendar methods.
In those cases, round to 2 ns, rather than 1 ns.
2023-09-13 10:57:43 +02:00
Philip Chimento 5c7f4009dc Temporal Helpers: Avoid observable calendar ID lookup in OneShiftTimeZone
This toString() call would observably get the `id` property of the
plainDateTime's calendar object. Not good for the tests that I am writing
that verify observable calls!
2023-09-08 09:38:14 -07:00
Mathias Bynens 1a0b9d23f2 Add tests ensuring the latest Unicode Emoji standard is being followed
The behavior of `/\p{RGI_Emoji}/v` and other properties of strings depends on the Unicode & Emoji version being used in the JavaScript engine. This patch adds tests verifying new additions to `RGI_Emoji` for each release of the Unicode Emoji standard are correctly matched.
2023-08-28 16:31:57 +02:00
André Bargull 71091f1541 Use simplified PartitionDurationFormatPattern to computed expected results 2023-08-28 16:18:47 +02:00