Commit Graph

6545 Commits

Author SHA1 Message Date
André Bargull 3499832c3c Update built-ins/Object/defineProperty to use verifyProperty 2024-02-28 17:01:01 -08:00
Frank Yung-Fong Tang a2597599bc Add test for ECMA402 PR846
the calenar name should be canonicalized
Spec change https://github.com/tc39/ecma402/pull/846
2024-02-23 15:53:00 -08:00
Aditi 0fd1675f7e Temporal: Add weekOfYear() and yearOfWeek() tests for custom calendars 2024-02-21 10:40:18 -08:00
Aditi ae8fe25b5a Temporal: Tests for week-numbering algorithm 2024-02-21 10:40:18 -08:00
Nicolò Ribaudo c0e8eef81b
Add test for async module not blocking sync siblings (#3955) 2024-02-21 14:53:10 +01:00
Rezvan Mahdavi Hezaveh 45e740928f [test262] Add staging test for RegExp named groups (search)
This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: Id8982a3d18bca219133f672736064e4d57d6da59
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5294455
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92372}
2024-02-16 18:21:13 +01:00
Rezvan Mahdavi Hezaveh 903f7fc74d [test262] Add staging test for RegExp named groups (replace)
This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: Id24a5b5665bbc491acd59c16ede80d6780bbd4b2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5293730
Commit-Queue: Liviu Rau <liviurau@google.com>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92363}
2024-02-16 16:18:20 +01:00
Rezvan Mahdavi Hezaveh 6f7ae1f311 [test262] Add new staging test for RegExp named groups
This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: I7f3d3aa3fbcf30b08cf3ebf2c61a683b7d2cf7c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5281634
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#92345}
2024-02-15 16:48:14 +01:00
André Bargull e98ff6c984 (Shared)ArrayBuffer constructor validation happens in correct order
Add tests to ensure that:
1. First `byteLength` isn't larger than `maxByteLength`.
2. Then `OrdinaryCreateFromConstructor` is called.
3. And finally `Create{Shared}ByteDataBlock` is called.
2024-02-12 14:18:33 +01:00
André Bargull 53984cf8c5
Add test with non-IANA time zone names (#4005)
Time zone identifiers supported by ICU, but which aren't valid IANA
identifiers.

Implementations not supporting ECMA-402 are theoretically allowed to
support these identifiers, so the tests have to go into the "intl402"
directory.
2024-02-12 12:06:04 +01:00
Lucas Mirelmann 403ee414ab
Fix comment in allow-nlt-before-with.js (#4001)
The proposed syntax allows a line terminator before the `WithClause`.
2024-02-09 16:36:41 -08:00
Nicolò Ribaudo 866d24deb2 Improve test robustness 2024-02-09 16:28:05 -08:00
Nicolò Ribaudo 98938f4c0a Add tests for `-->` in the first line 2024-02-09 16:28:05 -08:00
Philip Chimento 49e56acc67 Temporal: Tests for date difference algorithm
This adds tests specifically for every kind of case that changes due to
the tweak to the date difference algorithm: differences from a longer
month to a shorter month, when the months are adjacent, in the same year
but not adjacent, and in different years.

Also adds tests for a case that does *not* change, but would trip on an
incorrectly implemented algorithm: when the intermediate months value
falls at the end of February.

There was incidental coverage of the change to the date difference
algorithm in other tests. Those are adjusted, as well.

Normative change: https://github.com/tc39/proposal-temporal/pull/2759
Consensus in February 2024
2024-02-09 16:03:33 -08:00
Igor Sheludko f742eb092d [test262] Add a new staging test for Array.p.flatMap
Bug: v8:14306
Change-Id: Ibc7a04288a0c31bfcf601aa864e02b6c067045c2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5259306
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#92174}
2024-02-05 15:05:01 +01:00
Philip Chimento 3e7938c1f5 Temporal: Prevent arbitrary loops in NormalizedTimeDurationToDays
Adapts the tests that checked arbitrarily long loops, to now check that an
exception is thrown if the loop would happen.

Adds tests that exercise the newly added checks on return values of
getPossibleInstantsFor and getOffsetNanosecondsFor that limit UTC offset
shifts to 24 hours or less.

Also updates some step numbers in related tests.
2024-02-02 08:43:11 -08:00
Nicolò Ribaudo 584048ed08 Add additional tests for out-of-range date-times
- https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414066610
- https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414065876
- https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414067272
2024-01-31 08:22:05 -08:00
André Bargull 0de91996e7 Add tests for precise results in Duration.p.total and ZonedDateTime.p.hoursInDay
The existing tests didn't cover some edge cases where implementations
have to compute the exact result of `numerator / denominator`, where at
least one of `numerator` and `denominator` can't be exactly represented
by an IEEE-754 double precision floating point value.

"precision-exact-mathematical-values-5.js" gets added in #3961, so the
new tests from this commit start at "precision-exact-mathematical-values-6.js".
2024-01-31 08:22:05 -08:00
Philip Chimento 99d5bc8c1b Temporal: Limit duration years, months, and weeks to <2³² each 2024-01-31 08:22:05 -08:00
Philip Chimento 01ec9938bb Temporal: Limit day length calculations to safe integers
NormalizedTimeDurationToDays can no longer loop indefinitely, because at
a certain point we will hit the upper bound of MAX_SAFE_INTEGER, so rename
the test to reflect that it can loop an arbitrary but limited number of
times.

Add a test for the RangeError condition in NormalizedTimeDurationToDays
when the time zone calculates a day length that is not a safe integer
number of nanoseconds.

While editing these tests, rename them to match the current name of the AO
and make sure the step numbers are up to date. (Normally I wouldn't care
so much about that, but these tests can be pretty confusing so it's good
to be able to refer to the spec text.)
2024-01-31 08:22:05 -08:00
Philip Chimento 092337c8d0 Temporal: Adapt tests to upper bound on time portion of durations
Adapts or removes tests that relied on creating durations that are now out
of range. Adds new tests for maximum in-range and minimum out-of-range
durations.
2024-01-31 08:22:05 -08:00
Michael Ficarra e4f91b6381
fix broken Iterator.prototype constructor/Symbol.toStringTag tests (#3996)
* fix broken Iterator.prototype constructor/Symbol.toStringTag tests

* fix lint: unused includes
2024-01-24 17:37:28 -08:00
Ioanna M. Dimitriou H fed13c1915 Tests using yield*, also to test codepath via .throw()
This includes the test case mentioned in ecma262 issue comment:
https://github.com/tc39/ecma262/issues/1849#issuecomment-576912421

Also using yield* we can test the changes to AsyncFromSyncIteratorContinuation
when called via .throw().
2024-01-23 13:31:50 -08:00
Ioanna M. Dimitriou H 2e44b8f13f Test that the sync iterator called via for-await-of closes
when a rejected promise is returned normally by the iterator.

These tests correspond to this normative changes example:
https://docs.google.com/presentation/d/1W9EJoWOvi6jU1A2bwyixzOceoP_ASAeaOYER3Zy9P00/edit#slide=id.g10c9207737d_0_31
2024-01-23 13:31:50 -08:00
Ioanna M Dimitriou H 1f380f3750
Test closing async-from-sync iterator when resolving result promise abrupt completes. (#3977)
* Test closing async-from-sync iterator when resolving result promise abrupt completes.

These test new steps 6-6.a of AsyncFromSyncIteratorContinuation
as per normative changes of ecma626 PR 2600
https://github.com/tc39/ecma262/pull/2600

* Apply suggestions from code review

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>

* Apply suggestions from code review

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>

* Refactoring tests to use the Async Helpers.

---------

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
2024-01-23 13:26:02 -08:00
Ioanna M Dimitriou H 2c58671789
Async-from-sync test the iterator closes when .throw() is undefined (#3976)
* Adjust existing tests to match new spec for async-from-sync iterators

Testing normative changes of ecma626 PR 2600

* Test that async-from-sync iterator closes when throw is undefined.

These test paths from newly added call to IteratorClose in step 7.c of
 %AsyncFromSyncIteratorPrototype%.throw
as per normative changes of ecma626 PR 2600

* Apply suggestions from code review

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

* Refactoring tests to use the Async Helpers.

Addresses review comments
- https://github.com/tc39/test262/pull/3976/files#r1451071569
- https://github.com/tc39/test262/pull/3976/files#r1451075479

---------

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-01-23 13:16:58 -08: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
Michael Ficarra 17ba9aea47
update constructor and Symbol.toStringTag properties on Iterator.prototype (#3970)
* update constructor and toStringTag properties on Iterator.prototype

* includes cannot be empty for some reason

* update description

* add esid

* updates

* freeze Iterator.prototype

* don't try to use real GeneratorPrototype for these tests
2024-01-15 15:40:01 -08:00
Nicolò Ribaudo bebce4a5ee Make sure that the test always throws a SyntaxError 2024-01-15 15:16:53 -08:00
Nicolò Ribaudo 8b1bd25b49 Do not expect specific error type in import-attributes/allow-nlt-before-with.js
Hosts are free to throw whatever error they want during module loading: there is no guarantee that the error thrown due to the import with `type: "foo"` is a SyntaxError.
2024-01-15 15:16:53 -08:00
Justin Grant a1ba783ca3 Add 402 staging tests: Islamic & Persian calendars
Tests the changes in https://github.com/tc39/proposal-temporal/pull/2743
2024-01-12 16:42:31 -08:00
Kevin Gibbons 9c4e0fd902
introduce nonClampedIntArrayConstructors (#3984) 2024-01-11 11:35:28 +01:00
Jordan Harband c2aaae4cc3
Merge pull request #3985 from rmahdav/fix-differnce-test-2
Fix an error in expected value of difference set method
2024-01-10 17:38:56 -08:00
Rezvan Mahdavi Hezaveh 080f11f2ad The difference between two sets is `[1]`. 2024-01-11 00:23:14 +00:00
Kevin Gibbons c8cd136888
More set methods tests (#3966)
* add tests for difference, intersection, symmetricDifference

* add tests for predicates

* more tests for ordering of calls

* fix copyrights

* add missed -0 test

* pass argument to methods, not just this

* assert methods return new objects

* typo in filename

* fix parens

* Update test/built-ins/Set/prototype/difference/add-not-called.js

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

* fix isSupersetOf/set-like-array.js

* add tests for negative zero with isDisjointFrom and isSupersetOf

* fix message in isSupersetOf/converts-negative-zero.js

* address comments from review

---------

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-01-10 12:52:41 -08:00
Ben Allen 80590ce79a Added tests to verify that use of "long", "short", or "narrow" styles for units following units using "numeric" or "2-digit" styles throws 2024-01-10 14:50:08 +01:00
Kevin Gibbons 67a5153cf5
add Float16Array to all generic TypedArray tests (#3849) 2024-01-10 14:07:57 +01:00
Clonex 211195bb08
Fixed website section in README (#3981)
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2024-01-09 10:48:12 +01:00
Kevin Gibbons 5a263f5b19 add the TypedArray feature flag to some tests which were missing it 2024-01-08 17:21:46 -08:00
Michael Dyck 816b6b14d8 Delete trailing space from "info: |" lines 2024-01-08 16:04:41 +01:00
Michael Dyck c194ad6936 Delete extra slash in Copyright section 2024-01-08 16:04:41 +01:00
Jordan Harband 4393acd575 Array length: add test ensuring RangeError is thrown 2024-01-08 15:41:52 +01:00
Lucas Mirelmann b628e4b054 Update single-line-html-close.js
Fix comment with the description of the syntax
2023-12-18 09:42:42 -05:00
Philip Chimento 6cbb6da947 Temporal: Change overflow behaviour of PYM/PMD.toPlainDate
These tests cover the proposed normative change:
https://github.com/tc39/proposal-temporal/issues/2706
2023-12-04 14:59:58 -08:00
Linus Groh 32540f3034 Fix property name in Atomics.isLockFree() descriptor test 2023-12-04 13:48:06 +01:00
Rezvan Mahdavi Hezaveh 467a0fe68f [test262] Add staging tests for isSubsetOf set method
This CL adds three tests to staging directory of test262.

Bug: v8:13556
Change-Id: Id6e468a0fa29528350a10c94e9dd19c2835788e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5055866
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#91139}
2023-11-27 18:49:17 +01:00
Richard Gibson 2060494f28 Test for assignment with target wrapped in two sets of parentheses 2023-11-21 09:51:03 -05:00
Kevin Gibbons 718aa71683 Consolidate set methods features 2023-11-20 09:17:29 +01:00