Commit Graph

2782 Commits

Author SHA1 Message Date
Peter Hoddie 83fae7f1f2 a few tests use verifyPrimordialProperty 2024-10-11 12:45:30 -07:00
André Bargull 92b592547d Ensure NaN time values are correctly handled in various Date setters
Related PR: https://github.com/tc39/ecma262/pull/2136
2024-10-11 12:19:13 -07:00
Richard Gibson 5ae7de9942
Increase coverage of String.prototype.replace $xy replacement patterns (#3931)
* $xy is a valid capture index
* $xy is not a valid capture index but $x is
* neither $xy nor $x is a valid capture index
2024-10-10 14:08:45 +02:00
tannal 954d6370f9 Avoid using destructuring in tco-fn-realm.js 2024-10-09 19:52:05 -07:00
Rezvan Mahdavi Hezaveh 6c967a8bbb Remove extra `.js` from file name 2024-10-07 10:58:18 -07:00
Philip Chimento 459cef7185 Temporal: Add coverage for validating offset string syntax vs suitability
Syntax is validated first. Only after the property bag is fully converted
into a Calendar Fields Record does the time zone validate whether the UTC
offset is correct for that exact time in the time zone.

See tc39/proposal-temporal#2962
2024-10-07 12:02:45 +02:00
Philip Chimento 6dced5dead Temporal: Add coverage for validating month code syntax vs suitability
Syntax is validated first. Only after the property bag is fully converted
into a Calendar Fields Record does the calendar validate whether the month
code actually exists in the year.

See tc39/proposal-temporal#2962
2024-10-07 12:02:45 +02:00
Philip Chimento 09c7d33253 Temporal: Add coverage for disallowed seconds in offset time zone identifiers
This was an area missing test coverage.
2024-10-07 12:02:45 +02:00
Ioanna M Dimitriou H 1332b14d69
Merge branch 'main' into regex-v-flag-follow-up 2024-10-04 18:33:01 +02:00
tannal d7d02aedca fix errors 2024-10-04 14:13:23 +08:00
Rezvan Mahdavi Hezaveh 06ea308d14 Remove one of the `.js`s from the test name 2024-10-03 16:41:38 -07:00
Philip Chimento f4a987fe3c Temporal: Additional tests for cases where date addition goes out of range
See tc39/proposal-temporal#2985
2024-10-03 12:14:41 +02:00
Philip Chimento 326cdb8da8 Temporal: Consistently test all string entry points for representable range
Remove the existing "instant-string-limits.js" that only applied to APIs
where ToTemporalInstant was called. Add "argument-string-limits.js" tests
everywhere ISO strings are converted.

Related to tc39/proposal-temporal#2985
2024-10-03 12:14:41 +02:00
Philip Chimento 116bc2cc47 Temporal: Move UTC offset ±24:00 into invalid string tests
It was in the "limits of representable range" tests, but it is invalid
syntax, so it belongs somewhere else.
2024-10-03 12:14:41 +02:00
Richard Gibson 585d7ac2b3 Test TypedArrays with excess bytes in their underlying buffers 2024-10-02 16:38:41 -07:00
tannal 5c20b3bd85 Add basic tests with u flag in v flag tests. 2024-09-28 18:12:21 +08:00
Huáng Jùnliàng 1a0aa3b866 fix: syntax error in DisposableStack test 2024-09-27 15:29:36 +02:00
Philip Chimento f225229f85 Remove FinalizationRegistry tests that depend on nondeterministic GC
In these tests, cleanupSome() would have optionally emptied the
FinalizationRegistry synchronously and called the finalization callbacks.
Without cleanupSome(), there is no way to observe a FinalizationRegistry
being emptied using "pure" ECMAScript: FinalizationRegistry doesn't get
cleaned up until the microtask queue is empty, and without external APIs
such as setTimeout() there is no way to pause execution until after the
microtask queue is empty.

Non-deterministic tests are not that useful anyway; these tests are
probably better left to implementations' internal testing strategies.
2024-09-25 10:06:15 -07:00
Philip Chimento 77b1c787e8 Remove WeakRef/prototype/deref/gc-cleanup-not-prevented-with-wr-deref.js
On all engines that still support cleanupSome, this test was hitting the
asyncGC.notCollected check in resolveAsyncGC(). That means that it was
just skipped, and the deref() part was never actually executed.

Given that it is not testing anything in practice, remove it.
2024-09-25 10:06:15 -07:00
Philip Chimento 3bed2c446f Remove tests for FinalizationRegistry.prototype.cleanupSome
This proposal was split off from FinalizationRegistry at stage 2, and then
withdrawn. Given that status, it should not be part of the test suite.
2024-09-25 10:06:15 -07:00
SkyCrystal 957ab22773
Add a test for Generator (#3729) 2024-09-25 12:58:24 -04:00
Ioanna M Dimitriou H c63d53ad9c
Builtin boilerplate tests from PR #3866 (#4236)
Includes some proto-from-ctor-realm.js tests that look like standard tests for prototypes.

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-09-24 14:04:28 +02:00
Shu-yu Guo fcfb11da77 Remove test for old behavior for Atomics.pause 2024-09-20 15:34:26 -07:00
tannal 474af83250 Add more tests for v flag 2024-09-20 11:10:54 -07:00
Ron Buckton dc7a22dd28 Function branding boilerplate tests from PR #3866 2024-09-20 10:48:23 -07:00
SUZUKI Sosuke 8cbcc309e6
Add tests for `%WrapForValidIteratorPrototype%.return()` from Iterator Helpers Proposal (#4214)
* Add tests for `%WrapForValidIteratorPrototype%.return()`

* Address review

- Remove unused `flags
- Do not use `deepEqual.js`
- Assert `return` never got when `this` value is invalid
- Use `TemporalHelpers` to observer get / call
2024-09-13 11:41:43 -07:00
Mathias Bynens 77e98fb683 Add tests for Unicode v16 property escapes
Issue: https://github.com/tc39/ecma262/issues/3425
2024-09-13 14:42:42 +02:00
Mathias Bynens 83c58c5055 Move updated `unicodeSets` tests to their appropriate location 2024-09-13 14:38:51 +02:00
Shu-yu Guo a9c1c08852
Migrate resizable buffer tests out of staging (#3888)
Co-authored-by: Ioanna M Dimitriou H <idimitriou@igalia.com>
2024-09-12 11:26:33 +02:00
Paul Bakker 98c7e9114e
Test computed accessor properties and AggregateError constructor without arguments (#4222) 2024-09-11 11:41:07 +02:00
Philip Chimento c93ae0ac2f Temporal: Tests for disallowed corner case in rounding durations
This test covers a normative change to disallow an ambiguous corner case
in the options bag for Temporal.Duration.prototype.round().

See https://github.com/tc39/proposal-temporal/pull/2916
2024-09-05 15:08:08 -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
André Bargull b9ed8c920c Add more tests for typed array indices in typed array set 2024-08-27 15:24:28 +02:00
Philip Chimento ea11e0e787 Temporal: Further coverage and tweaks for removing Calendar/TimeZone objs
Tweak some tests to provide coverage of new execution paths in the spec,
such as calling GetOptionsObject inside ToTemporal___; add a few new tests
for things that weren't covered before, such as rounding a PlainDateTime
at the edge of the range; and tweak the tests verifying when the
properties of the options bag are read, which I made a mistake in #4119.

See: https://github.com/tc39/proposal-temporal/pull/2925
2024-08-22 14:00:43 -07:00
Michael Ficarra 22967c5b7b Math.sqrt: add a test with exact input-output expectations 2024-08-20 10:29:05 -07:00
Ms2ger 941813e1f0 Revert "Revert "Add invalid index Reflect.set tests""
This reverts commit b110681292.
2024-08-16 17:26:15 +02:00
Ms2ger 79faa2252a Revert "Revert "Add invalid index prototype chain [[Set]] tests""
This reverts commit 3d77404e4f.
2024-08-16 17:26:15 +02:00
Ms2ger 44685c14d7 Revert "Revert "Add valid index Reflect.set tests""
This reverts commit b90326d9a4.
2024-08-16 17:26:15 +02:00
Ms2ger efa4272ffb Revert "Revert "Add valid index prototype chain [[Set]] tests""
This reverts commit bd65623af6.
2024-08-16 17:26:15 +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
Philip Chimento cb4a6c8074 Temporal: Add a test for a coverage gap in Duration.prototype.round
See https://github.com/tc39/proposal-temporal/issues/2919; this adds test
coverage that would have caught an unintentional normative change.
2024-08-15 10:26:58 +02: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