Commit Graph

219 Commits

Author SHA1 Message Date
Richard Gibson 585d7ac2b3 Test TypedArrays with excess bytes in their underlying buffers 2024-10-02 16:38:41 -07:00
Ioanna M Dimitriou H fc49c9ce16
Move function MayNeedBigInt to RAB helper file and inline WriteToTypedArray. (#4211) 2024-09-03 16:23:23 +02:00
Ioanna M Dimitriou H 3acb672d11
RAB: Integrate helper to rest of the tests (#4198)
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-08-27 17:18:44 +02:00
André Bargull a4443793b9 Add coverage when array buffer is resized in SetTypedArrayFromArrayLike 2024-08-27 15:24:28 +02:00
Ioanna M Dimitriou H 224c5c3cb9
RAB: Integrate staging tests for the .subarray method (#4177)
* Import relevant files from #3888

* Adds resizableArrayBufferUtils.js to includes and removes its content from each test

* renamed tests to indicate the end argument is tested too

* Adds more tests for the 'end' argument of .subarray
2024-08-15 15:13:34 -07:00
Ioanna M Dimitriou H b1d0933df5
RAB: Integrate staging tests for the .toLocaleString method (#4178)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Apply suggestions from code review

* Address review: get implementation dependent toLocaleString separator.

* Apply suggestions from code review
2024-08-14 12:30:54 -07:00
Ioanna M Dimitriou H 12307f5c20
RAB: Integrate staging tests for the .slice method (#4174)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Add coerced-start-shrink test for Array.p.slice

* Renames files to add more tests for the end argument of .slice.

* Tests for the 'end' argument of .slice and test file for Array.p.slice
parallel to TypedArray.p.slice resizable-buffer.js
2024-08-13 17:03:51 -07:00
Ioanna M Dimitriou H bcb42e339d
RAB: Integrate staging tests for the .some method (#4175)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Address review comments.
2024-08-09 09:05:04 -07:00
Marko Lahma 5dc04b7332 Fix TypedArray.reduce tests against RAB
* reduce callback has call signature «accumulator, kValue, 𝔽(k), O »
2024-08-06 15:15:19 -07:00
Ioanna M Dimitriou H dc36c7eae9
RAB: Integrate staging tests for the .values method (#4179)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Removes unnecessary .from calls, as suggested in previous PR review
comment: https://github.com/tc39/test262/pull/4138#discussion_r1676183221
2024-08-05 17:26:21 -07:00
Ioanna M Dimitriou H ef72bd1c44
RAB: Integrate staging tests for the .sort method (#4176)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Renamed test files

* Some minor documentation fixes and removing onlyStrict flag
2024-08-05 17:22:10 -07:00
Ioanna M Dimitriou H c0942e0883
RAB: Integrate staging tests for the .set method (#4173)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
and renaming helper function.
2024-08-05 14:09:41 -07:00
Ioanna M Dimitriou H 1842afcbce
RAB: Integrate staging tests for the .reduce method (#4156)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.

* Added missing 'shrink' test for Array.prototype.reduce

* Deleted accidental files

* Fix accidental call of .map instead of .reduce

Addresses review comments

* fix copyright in new file not in origin PR
2024-07-29 17:33:50 -07:00
Ioanna M Dimitriou H 242f6f98f0
RAB: Integrate staging tests for the .map method (#4155)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.

* Apply suggestions from code review
2024-07-25 16:04:41 -07:00
Ioanna M Dimitriou H 18ebac8122
RAB: Integrate staging tests for the .reverse method (#4160)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.
2024-07-24 16:55:16 -07:00
Ioanna M Dimitriou H 1dd1b91d14
RAB: Integrate staging tests for the .reduceRight method (#4157)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.

* Added missing 'shrink' test for Array.prototype.reduceRight
2024-07-24 16:39:27 -07:00
Ioanna M Dimitriou H ba92881748
RAB: Integrate staging tests for the .length method (#4154)
* Import relevant files from #3888

* Adds resizableArrayBufferUtils.js to includes and removes its content
from each test. Also splits tests for .byteLength and .byteOffset to
new files in the respective directories.

Test lines calling .buffer in .../length/resizable-buffer-assorted.js
were not split to .../buffer/ as they seem to only do a check for the
test on .length but perhaps they need to be also split to a new file
.../buffer/resizable-buffer-assorted.js
2024-07-23 16:42:45 -07:00
Ioanna M Dimitriou H 63e81baf5b
RAB: Integrate staging tests for the .lastIndexOf method (#4153)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Some changes for readability.
2024-07-17 17:37:17 -07:00
Ioanna M Dimitriou H 97cf4fd6e9
RAB: Integrate staging tests for the .keys method (#4138)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Removes redundant documentation

* Address review comments.
2024-07-16 09:25:18 -07:00
Ioanna M Dimitriou H 694fae5b10
RAB: Integrate staging tests for the .join method (#4137)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Removes forgotten ArrayJoinHelper
2024-07-12 09:32:10 -07:00
Ioanna M Dimitriou H ab0c31a458
RAB: Integrate staging tests for the .indexOf method (#4136)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.

* Restructures ArrayIndexOfNumOrBigInt to use MayNeedBigInt as it seems clearer.

* Adds missing test file for Array.prototype.indexOf
2024-07-11 16:05:07 -07:00
Ioanna M. Dimitriou H 441cbef061 Restructures ArrayIncludesNumOrBigInt to use MayNeedBigInt as it seems clearer. 2024-07-11 15:57:08 -07:00
Ioanna M. Dimitriou H 3dde047c84 Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while applying review changes from PRs for previously tested methods.
2024-07-11 15:57:08 -07:00
Ioanna M. Dimitriou H 14de2ce388 Import relevant files from #3888 2024-07-11 15:57:08 -07:00
Ioanna M. Dimitriou H 0ce0bd7314 Renames ResizeBufferMidIteration to ResizeMidIteration 2024-07-11 15:42:35 -07:00
Ioanna M. Dimitriou H 8ca7c1a42a Adds missing Array.prototype.filter \'shrink\' tests and some typesetting 2024-07-11 15:42:35 -07:00
Ioanna M Dimitriou H 41958b6a90
RAB: Integrate staging tests for the .forEach method (#4134)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.

* Added missing 'shrink' tests for Array.prototype.forEach and removed forgotten lines

Also renames ResizeBufferMidIteration to ResizeMidIteration

* Forgotten by copy paste
2024-07-09 18:07:33 -07:00
Ioanna M Dimitriou H 673856839c
RAB: Integrate staging tests for the .findLastIndex method (#4129)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.
2024-07-04 13:15:53 -07:00
Ioanna M Dimitriou H 6f2eeebdcc
RAB: Integrate staging tests for the .findLast method (#4128)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.
2024-07-04 12:48:33 -07:00
Ioanna M Dimitriou H 105906a49c
RAB: Integrate staging tests for the .findIndex method (#4127)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.
2024-07-04 12:12:02 -07:00
Ioanna M Dimitriou H e023765890
RAB: Integrate staging tests for the .find method (#4126)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.
2024-07-04 11:05:24 -07:00
Ioanna M Dimitriou H a507aa01de
RAB: Integrate staging tests for the .filter method (#4125)
* Import relevant files from #3888

* Removing parts in resizableArrayBufferUtils.js and adding it in includes,
while adjusting usage of CollectValuesAndResize and applying review changes
from PRs for previously tested methods.

* Addresses review comment removing forgoten onlyStrict flag

a62d978ca6 (r1663298683)
2024-07-04 08:35:13 -07:00
Ioanna M Dimitriou H d2596e2651
RAB: Integrate staging tests for the .every method (#4074)
* RAB: Integrate staging tests for the .every method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js

* Added missing includes

* Removed unnecessary function call.

* Apply suggestions from code review

* Applied review suggestion to the rest of the files

* Addressed forgotten review comment noting some files are missing.

https://github.com/tc39/test262/pull/4074#pullrequestreview-2046589557

Adds forgotten tests from #3888

* Addresses review comment.

* Fixed forgotten rename

* Simplify the tests and add documentation.

New approach replaces ...Helper with CollectResize to make the tests easier to understand.
In particular:
- Replaced the need for '...Helper' abstractions with a more descriptive
  function 'ResizeBufferMidIteration', which the .every method can call
  directly.
- Moved 'let values' back outside of the loops, together with a function
  definition 'ResizeBufferMidIteration' to persist the side effects that
  'CollectValuesAndResize' has on 'values' but without having to define
  this inside every loop.
  + So this reverts commit d9a2bac41f87f0964a43d34c6f349b6d78401633 and
  + this reverts commit 0bc2d66335671cac56912981b73c7900bf309cee.
- Added documentation.

* Documentation style change and remove accidental additions.
2024-06-28 16:42:09 -07:00
Ioanna M Dimitriou H c2815ec090
RAB: Integrate staging tests for .fill method (#4075)
RAB: Integrate staging tests for the .fill method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-06-26 16:26:22 -07:00
Ioanna M Dimitriou H cbdff1ca5f
RAB: Integrate staging tests for the .entries method (#4073)
RAB: Integrate staging tests for the .entries method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-06-26 16:12:35 -07:00
Ioanna M Dimitriou H d7b2f4acfc
RAB: Integrate staging tests for .copyWithin method (#4072)
RAB: Integrate staging tests for .copyWithin method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-06-26 16:05:45 -07:00
Ioanna M Dimitriou H 55a5346f99
RAB: Integrate staging tests for .byteLength method (#4071)
* RAB: Integrate staging tests for .byteLength method
of TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-05-08 08:35:46 -07:00
Ioanna M Dimitriou H 0fca7339eb
RAB: Integrate staging tests for .at method (#4070)
* RAB: Integrate staging tests for .at method
of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
2024-05-08 08:27:49 -07:00
Philip Chimento 837def66ac Apply suggestions from code review
Co-authored-by: Ioanna M Dimitriou H <9728696+ioannad@users.noreply.github.com>
2024-03-27 17:49:35 -07:00
André Bargull 71f95c29bd Add tests for resizable array buffer views
Covers spec compliance issues in at least one of JSC, V8, or SM.
2024-03-27 17:49:35 -07:00
Kevin Gibbons 961480ac61 remove some auto-generated error messages in "assert.throws" tests 2024-03-25 12:09:10 +01:00
Kevin Gibbons 5424d7e834 rewrite tests to use verifyProperty 2024-03-25 12:05:06 +01:00
Kevin Gibbons 67a5153cf5
add Float16Array to all generic TypedArray tests (#3849) 2024-01-10 14:07:57 +01:00
Philip Chimento be0abd93cd Add copies of resizable ArrayBuffer species constructor tests to BigInt folders
This adds copies of the tests added in the previous commit, to the
respective BigInt folders, editing them to use the testBigIntTypedArray
helper instead of the testTypedArray helper.

See: #3723
2023-03-31 16:52:42 -07:00
Aditi 8330bd6567 Add resizable ArrayBuffer tests in %%TypedArray%% 2023-03-31 16:52:42 -07:00
Yusuke Suzuki 83a46bfe0e
test/built-ins/TypedArray/prototype/map/callbackfn-resize.js test result is incorrect (#3721)
%TypedArray%.prototype.map's iteration count does not change even though the source view is resized during the iteration.
And since result is just returning index, then result array should be [0, 1, 2].
2022-11-18 14:17:12 -05:00
Linus Groh 5a858cc0c4 Add missing includes to toSorted/toReversed this-value-invalid.js tests
Otherwise $DETACHBUFFER() is not defined in those files.
2022-10-18 14:05:01 +02:00
Nicolò Ribaudo 6f4601d095
Add "Change Array by Copy" tests (stage 3) (#3464)
Co-authored-by: Ashley Claymore <acutmore@users.noreply.github.com>
Co-authored-by: Tim Chevalier <tjc@igalia.com>
Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2022-10-18 10:16:20 +02:00
Shu-yu Guo 1c19242ae4 Remove check for per-iteration detach check in TypedArray.prototype.set
Note that this test currently unintentionally passes, because a
TypeError is thrown for failing to convert the undefined returned from
the getter to a BigInt. But since this test was intended to test
detaching, it's no longer valid and should still be removed.

See https://github.com/tc39/test262/pull/3465#issuecomment-1098388916
2022-04-13 21:24:57 -04:00
Shu-yu Guo d7c0a2076c Remove check for per-comparator call detach check in TypedArray.prototype.sort
This updates tests in line with the normative change in
https://github.com/tc39/ecma262/pull/2723
2022-04-05 11:25:05 -04:00