Commit Graph

6373 Commits

Author SHA1 Message Date
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
Philip Chimento 27a7501893 Temporal: Limit year, month, and week length calculations to nonzero
Tests with conditions that would trip a division by zero in
implementations if they didn't carefully implement the spec.
2023-11-16 11:08:42 -08:00
Philip Chimento bcb409148d Temporal: Remove loops in RoundDuration 2023-11-16 11:08:42 -08:00
Philip Chimento e43e20a885 Temporal: Remove BigInt arithmetic and loops in BalanceDurationRelative
A few results change because the algorithm previously used for rounding
didn't always add duration units to dates in RFC 5545 order, and we also
introduce a special case for rounding with largestUnit years or months and
smallestUnit weeks.
2023-11-16 11:08:42 -08:00
Philip Chimento 50abc12d97 Temporal: Remove BigInt arithmetic and loops in UnbalanceDurationRelative 2023-11-16 11:08:42 -08:00
André Bargull b218cf6dec Replace "imp" module with "importlib" in parseTestRecord
The "imp" module is deprecated in Python 3.4 and will be removed in
Python 3.12. Use it only if the current Python version is too old to use
the "importlib" module.
2023-11-15 09:15:47 -08:00
Anthony Frehner 60310b70bc
Add Set.prototype.union tests (#3816)
* Beginning of adding Set.prototype.union tests

* Fix description

* Add tests for GetSetRecord

Which also allows Set-like objects

* Add title to test descriptions

* Add test for ensuring values are appended

* Add tests for properties of union

Also: tests for RequireInternalSlot, Constructor, BuiltIns.

Added a test to ensure that -0F is converted to +0F

* Ensure Set.prototype.add is not called as part of .union

* fix lint issues

* Set subclassing and Symbol.species tests

* Set.prototype.union tests for arrays and subclass methods

* Add the Set-methods frontmatter feature flag

* Add additional Set.prototype.union test for edge cases

* Update test/built-ins/Set/GetSetRecord/keys-is-callable.js

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

* Use compareArray() for assertions

* Remove class field syntax

* Remove unused args

* Update test/built-ins/Set/prototype/union/subclass-receiver-methods.js

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

* Return original 'add'

* address comments

* add one more mutation in the evil mutating iterator test

* address further comments

---------

Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2023-11-15 17:55:47 +01:00
Philip Chimento 5962be6d66 Temporal: Combine expected relativeTo operations for readability in Duration.compare
Code review suggestion from Richard.
2023-11-14 11:44:00 -08:00
Philip Chimento dc1c787cc8 Temporal: Make calendar method lookups unconditional
See https://github.com/tc39/proposal-temporal/issues/2724
2023-11-14 11:44:00 -08:00
Philip Chimento 3e23610431 Temporal: Make time zone method lookups unconditional
See https://github.com/tc39/proposal-temporal/issues/2724
2023-11-14 11:44:00 -08:00
Philip Chimento 7c41695f78 Adjustments to tests for added invocations of BalanceDurationRelative
In order to fix tc39/proposal-temporal#2563, we added invocations of
BalanceDurationRelative after some invocations of RoundDuration. These
cause observable calendar calls, which must be accounted for in some
existing tests.
2023-11-14 10:03:45 -08:00
Philip Chimento 93304c7571 Tests for Duration rounding bug when rounding crosses a unit boundary
See https://github.com/tc39/proposal-temporal/issues/2563

The old behaviour was encoded in one test in staging, but the behaviour of
largestUnit in duration rounding has changed since that test was written.
Therefore I'm assuming that toString() should've been updated when that
happened.
2023-11-14 10:03:45 -08:00
Frank Tang 96727cae1c Add test for firstDayOfWeek in LocaleInfo PR 70
Test for enhancement in
https://github.com/tc39/proposal-intl-locale-info/pull/70
2023-11-10 18:11:03 -08:00
André Bargull 873f260478 Update likely subtags tests for CLDR 44 2023-11-08 13:48:33 +01:00
André Bargull 4d44acbc03 Update case folding tests for Unicode 15.1
Unicode 15.1 added the following "simple" case-folding entries:
```
1FD3; S; 0390; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
1FE3; S; 03B0; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
FB05; S; FB06; # LATIN SMALL LIGATURE LONG S T
```
2023-11-08 13:43:44 +01:00
Ben Allen 99ac701b43
Test invalid region tags in Intl.DisplayNames.prototype.of() (#3900) 2023-11-07 15:09:53 +01:00
Philip Chimento 2a804d6c33 Temporal: Avoid extra Zoned→Plain conversion in AddDuration
Two more test cases for a fast path that previously wasn't tested.
2023-11-06 14:46:36 -08:00
Philip Chimento c5dd01f7c0 Temporal: Look up calendar methods only once 2023-11-06 14:46:36 -08:00
Philip Chimento 911fe9612e Temporal: Look up time zone methods only once 2023-11-06 14:46:36 -08:00
Veera c1281dba45 Test for Unicode Escape in Literals 2023-10-31 16:57:41 -07:00
Liviu Rau 8162f8c58f [test262] Add set method tests to staging
Reland https://crrev.com/c/4913993

This CL adds three tests from test methods tests to staging
directory with correct format.

Bug: v8:13556
Change-Id: I93817eb84e077436071dbae98bc800dd58851f91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4983674
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#90645}
2023-10-27 19:28:54 +02:00
Nicolò Ribaudo 0a6dabf1e2 Add readmes 2023-10-26 18:21:19 -07:00
Nicolò Ribaudo 41515e87e5 Use import-attributes flag in new generated tests 2023-10-26 18:21:19 -07:00