2133 Commits

Author SHA1 Message Date
Mike Pennisi
a6834093aa Improve coverage by invoking functions as intended
Some tests which include function declarations designed to verify
behavior do not reference those functions. Insert the references
necessary for those functions to serve their intended purpose.
2021-10-05 16:22:56 -04:00
legendecas
12e9d67bb5 Add tests for cross realms in ShadowRealm.prototype.evaluate 2021-10-04 15:39:12 -04:00
Mike Pennisi
c44cee291a Assert array equivalency
The `compareArray` utility function returns a boolean value describing
whether or not the input arrays are equivalent--it does not throw an
exception when invoked with non-equivalent arrays. Prior to this commit,
however, two tests invoked `compareArray` without inspecting its return
value, so it had no impact on the result of the test.

Update the tests to fail when the "expected" and "actual" arrays are not
equivalent.
2021-10-04 15:38:08 -04:00
Philip Chimento
56e537b916 Consolidate duplicate tests
There were a few tests already in the tree that overlapped ones that I
added in the previous commit. I've consolidated these and taken
information from the deleted ones where applicable, and improved on the
autogenerated assertion messages.
2021-10-01 14:30:12 -04:00
Philip Chimento
77a34cf93f Add Temporal tests
This copies over the tests that previously existed in the
tc39/proposal-temporal repository.

For context, see thread starting at:
https://github.com/tc39/test262/issues/3002#issuecomment-926234480

In service of https://github.com/tc39/test262/issues/3002
2021-10-01 14:30:12 -04:00
Mike Pennisi
d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be9b487eb10156c03e2c00869e88cc9d, reversing
changes made to 50dd431dffe5cf86e9064a652d6b01dbbe542cf0. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00
Philip Chimento
c7ca06acb2
Remove duplicate tests (#3222)
While working on adding the Temporal tests from tc39/proposal-temporal I
noticed that these tests tested the same thing as each of the branding.js
tests in the same directory. This removes the duplicate tests.
2021-09-30 20:17:12 -04:00
Mathias Bynens
04ad519be9
Update RegExp property tests per Unicode v14 (#3199)
Issue: https://github.com/tc39/ecma262/issues/2514
2021-09-30 11:48:47 -04:00
Leo Balter
10ad4c1593 Split tests and fix false positive 2021-09-27 14:59:12 -04:00
Phillip Mates
c768b9b8f2 Ensure that proxying wrapped functions preserves checks 2021-09-27 10:28:38 -04:00
rwaldron
4847d9db5a chore: update test/**/*.js to use assert.compareArray wherever applicable 2021-09-24 12:58:15 -04:00
Mike Pennisi
50dd431dff Focus test for BigInt v. of copyWithin method
Prior to this commit, a test for %TypedArray%.prototype.copyWithin
provided a TypedArray instance as the first argument. That argument that
is interpreted as a number, so in relying on the conversion, the test
verified behavior beyond what it purported to test.

Simplify the test by using the desired number value directly.
2021-09-24 11:21:19 -04:00
Mike Pennisi
de6583d61d Use BigInt values idiomatically
Prior to this commit, a number of tests used non-BigInt values where
BigInt value are commonly used. Although this was technically
permissible to validate the behavior under test, the atypical usage
patterns tended to obscure the tests' purpose. Replace with more
appropriate values.
2021-09-24 11:20:58 -04:00
Mike Pennisi
741db35b65 Correct arguments for BigInt-accepting methods 2021-09-24 11:20:29 -04:00
Mike Pennisi
8fad17a506 Focus tests for copyWithin methods
Prior to this commit, a test for %TypedArray%.prototype.copyWithin
provided a TypedArray instance as the first argument. That argument that
is interpreted as a number, so in relying on the conversion, the test
verified behavior beyond what it purported to test.

Simplify the test by using the desired number value directly, and extend
the tests for type coercion to cover object values.
2021-09-23 15:20:34 -04:00
Mike Pennisi
e6b64517a4 Correct assertion messages and improve coverage
Following a recent normative change to the Resizable ArrayBuffer
proposal [1], the term "out of bounds" no longer applies to
"length-tracking" TypedArrays whose underlying ArrayBuffer has been
resized to match their byte offset.

Reflect this in the tests by renaming the condition from "out of bounds"
to "on boundary" and by adding new assertions for true "out of bounds"
conditions.

[1] https://github.com/tc39/proposal-resizablearraybuffer/pull/70
2021-09-23 15:16:43 -04:00
Mike Pennisi
1b72bcd857 Correct mistakes in support of proposal change
Ensure that when the ArrayBuffer of a length-tracking TypedArray is
resized to the address matching the TypedArray's byte offset, the
TypedArray is *not* considered "out of bounds."
2021-09-23 15:16:15 -04:00
Rick Waldron
43f4453472
Update test/built-ins/ShadowRealm/prototype/evaluate/returns-proxy-callable-object.js
Co-authored-by: Leo Balter <leonardo.balter@gmail.com>
2021-09-22 12:42:24 -04:00
rwaldron
abdc0fa441 Add Proxy callable return test 2021-09-22 12:21:51 -04:00
rwaldron
e4adfd8979 fix: ensure check for ShadowRealm at start of test 2021-09-22 12:21:11 -04:00
Leo Balter
49819bc0bc Add more tests verifying errors from ShadowRealms evaluation 2021-09-22 10:32:44 -04:00
Frank Yung-Fong Tang
16dae73171
improve the case with the version without : (#3204) 2021-09-17 14:02:37 -04:00
Andreas Woess
2314b99bac
Fix incorrect tests: new Date(-0).valueOf() and new Date(-1.23e-15).valueOf() should return +0. (#3201) 2021-09-15 11:57:45 -04:00
Leo Balter
227977a8e6 Fix tests issues 2021-09-14 11:58:41 -04:00
Leo Balter
6a5b818896 Add more tests to ShadowRealms
Ref #3044
2021-09-14 09:06:58 -04:00
Richard Gibson
30eca7761b Add assertion messages 2021-09-13 10:09:42 -04:00
Richard Gibson
1a655779f0 Test lastIndex overwrite with big lastIndex 2021-09-13 10:09:42 -04:00
Phillip Mates
ed0532e231 syntax errors for ShadowRealm.evaluate should be exposed 2021-09-13 10:09:42 -04:00
Mike Pennisi
aa5c2adb7c Improve coverage: zonedDateTime & zonedDateTimeISO 2021-09-13 10:09:42 -04:00
Mike Pennisi
424406b5be Correct metadata 2021-09-13 10:09:42 -04:00
Mike Pennisi
57491d838f Import tests for Temporal.Now.zonedDateTimeISO
These tests originated in the Temporal proposal repository
https://github.com/tc39/proposal-temporal
2021-09-13 10:09:41 -04:00
Mike Pennisi
c99ec1780d Import tests for Temporal.Now.zonedDateTime
These tests originated in the Temporal proposal repository
https://github.com/tc39/proposal-temporal
2021-09-13 10:09:41 -04:00
Mike Pennisi
0232d97415 Add tests for Temporal.Now.plainDateTimeISO 2021-09-13 10:09:41 -04:00
legendecas
7c3d29686b Add test for byteOffset coverage in %typedarray%.prototype.copywithin 2021-09-13 10:09:41 -04:00
Mike Pennisi
e9fc3db379 Add test for normative change to TCO&revoked Proxy
Normative: phrase tail calls as discarding resources rather than popping
execution context stack
https://github.com/tc39/ecma262/pull/2495
2021-09-07 17:50:48 -04:00
Mike Pennisi
b62a070221 Simplify test
Remove semantics which are not necessary to exercise the behavior under
test.
2021-09-07 17:47:06 -04:00
Linus Groh
2b01f137ef Fix 'asserts.throws()' typo in two tests
This should be 'assert.throws()', otherwise these fail unexpectedly.

Fixes #3184.
2021-09-05 19:43:24 -07:00
Richard Gibson
50f3fca7a0
Test Math.hypot argument coercion (#3177)
* Test Math.hypot argument coercion

* Fix constructor
2021-09-03 15:59:25 -04:00
rwaldron
2fcc43df17 Transform legacy format to harness assertions: test/built-ins/N*/**/*.js 2021-09-02 11:34:34 -07:00
rwaldron
19d081ef1d Transform legacy format to harness assertions: test/built-ins/O*/**/*.js 2021-09-02 11:34:27 -07:00
rwaldron
2a385983b1 Transform legacy format to harness assertions: test/built-ins/P*/**/*.js 2021-09-02 11:34:18 -07:00
rwaldron
717bcbaedd Transform legacy format to harness assertions: test/built-ins/R*/**/*.js 2021-09-02 11:34:06 -07:00
André Bargull
0181293d38 "era" and "eraYear" are ECMA-402 only properties.
Both properties are only present when ECMA-402 is supported.
2021-09-02 11:23:23 -07:00
rwaldron
35ce309dc7 Transform legacy format to harness assertions: test/built-ins/F*/**/*.js 2021-09-02 11:22:11 -07:00
rwaldron
6a00f28e50 Transform legacy format to harness assertions: test/built-ins/i*/**/*.js 2021-09-02 11:22:05 -07:00
rwaldron
2944eb2eca Transform legacy format to harness assertions: test/built-ins/J*/**/*.js 2021-09-02 11:21:59 -07:00
rwaldron
ec9c9b8dfd Transform legacy format to harness assertions: test/built-ins/I*/**/*.js 2021-09-02 11:21:50 -07:00
rwaldron
1286bb601e Transform legacy format to harness assertions: test/built-ins/E*/**/*.js 2021-09-02 11:21:41 -07:00
rwaldron
f1720c4a0c Mark with "TODO: Convert to verifyProperty() format." 2021-09-02 11:21:25 -07:00
rwaldron
1c24e4b915 Transform legacy format to harness assertions 2021-09-02 11:21:25 -07:00