Commit Graph

732 Commits

Author SHA1 Message Date
Nicolò Ribaudo 7ef1833109 Move all tests using import assertions to files named as such 2023-07-17 16:32:25 +02:00
Michael Dyck f5c932144a Delete trailing space after `|`
I'm not sure if YAML disallows it,
but test262 avoids it.
2023-06-29 14:08:47 +02:00
Veera 88a2f0dcd1 Fix copyright 2023-05-18 11:19:31 -07:00
Veera 732cfff666 Fix YAML indentation 2023-05-18 11:19:31 -07:00
Veera bf337727a0 Try to fix CI errors 2023-05-18 11:19:31 -07:00
Veera 377231a1de Add tests for increment and decrement operations on `this` 2023-05-18 11:19:31 -07:00
Huáng Jùnliàng ff405fd0df update fixtures 2023-03-29 12:54:37 -07:00
José Julián Espina 4a6439e4a7
Add `Array.prototype.includes` and `exponentiation` features (#3799) 2023-03-23 10:51:08 +01:00
Cam Tenny 4fe158d39d Generated tests for refactoring (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Cam Tenny 4d9d5c570d Refactor simple cases of (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Philip Chimento cc559ac106 Rebuild generated tests 2022-11-30 16:04:02 -08:00
Philip Chimento d87a7da6e1 Replace Object.hasOwnProperty.call with Object.prototype.hasOwnProperty.call
While we're at it, use assert() instead of assert.sameValue() for brevity,
if we are not specifically testing that the return value of hasOwnProperty
is the value true or false; and add more informative assertion messages to
help with debugging.

In some cases, the Object.hasOwnProperty.call could be replaced with
verifyProperty(), if the property descriptor was also being verified at
the same time.

This fixes some tests that were faulty to begin with: a common mistake was
Object.hasOwnProperty(obj, prop) which is probably going to return false
when that's not what you want.

The only instances left of `Object.hasOwnProperty` are one regression test
in implementation-contributed which I can't tell if it was intentionally
needed to trigger the regression, and a few instances of
`Object.hasOwnProperty('prototype')` which would defeat the purpose to
convert into `Object.prototype.hasOwnProperty.call(Object, 'prototype')`
form.

Closes: #3524
2022-11-30 16:04:02 -08:00
Gokhan Kurt f5369c26a4 add async-functions feature to files which should have it 2022-10-17 11:21:23 +02:00
legendecas ee521159d5 Fix decorator tests 2022-06-23 15:17:43 -04:00
Youssef Soliman 79c4496559 Fixed spelling error identifer -> identifier. 2022-06-21 10:14:17 +02:00
Huáng Jùnliàng 79e3bc5176
add noStrict flag to yield-as-binding-id cases (#3551) 2022-06-09 09:01:21 +02:00
legendecas 6f8e0f67ca Decorators: add initial tests on class 2022-05-18 09:49:49 -04:00
Richard Gibson c58ac691eb Test that "infinity" is not recognized as numeric 2022-04-04 16:56:40 -04:00
Richard Gibson c572588ea9 Test that "INFINITY" is not recognized as numeric
Fixes #3442
2022-04-04 16:56:40 -04:00
Philip Chimento 615a2eb9a1 Fix tests for private reference with logical assignment
There were three things wrong with the 'and', 'or', and 'nullish' tests
that I added as part of #2940:

1. They were in the wrong folder (should be
   expressions/logical-assignment, not expressions/compound-assignment)
2. The tests for ||= and ??= on readonly accessor properties were
   incorrect. These assignments would short-circuit if the getter
   returned 1 as it previously did, so PutValue would not throw.
3. The tests for ||= and ??= on private methods were invalid, as a
   method always evaluates to true in a boolean context, and is not
   nullish, so these would always short-circuit.

I've removed the invalid private method cases, fixed the readonly
accessor cases, and added new templates to test the short-circuit
behaviour as well as the non-short-circuit behaviour.

Closes: #3413
2022-02-21 15:38:59 -05:00
Philip Chimento 1b1097dbf6 Add tests for compound assignment to private reference
This tests compound assignment, with each compound assignment operator,
to each kind of private reference (private field, private accessor
property with getter and setter, private accessor property with only
getter, and private method). The latter two cannot be assigned to and
therefore throw.

Closes: #2940
2022-02-16 09:56:59 -05:00
Csaba Osztrogonác 00f682e746 tools: enforce restriction on YAML negative key
The phase field must precede the type field for negative tests
to have a consistent style and be able to parse easier.
Related to the goal of https://github.com/tc39/test262/issues/1997

Added this check to the linting script and updated tests accordingly.
2022-01-10 13:50:38 -05:00
Daniel Nalborczyk 100af9014e generate tests 2021-10-22 09:00:00 -04:00
Mike Pennisi 8d420cef41 Remove unused functions 2021-10-13 14:18:32 -04:00
Rick Waldron 7be8fca485
fix: re-run clean and build on master to sync generated tests (#3247) 2021-10-06 15:47:46 -04:00
Mike Pennisi 8f1fb5c257 Remove unused functions 2021-10-05 16:24:16 -04:00
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
rwaldron 43c68163c0 Generate tests 2021-10-01 16:38:56 -04:00
Mike Pennisi d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be, reversing
changes made to 50dd431dff. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00
rwaldron 4847d9db5a chore: update test/**/*.js to use assert.compareArray wherever applicable 2021-09-24 12:58:15 -04:00
Mike Pennisi 650e7add4a Improve coverage for ops involving negative zero
Prior to this commit, the modified tests used the strict equality
operator to compare computed values with negative zero. Due to the
semantics of that operator, these tests would spuriously pass if the
value under test was in fact positive zero.

Update the tests to be more precise by instead asserting equality with
the `assert.sameValue` utility method (since that method correctly
distinguishes between negative zero and positive zero).
2021-09-16 16:35:41 -04:00
Mike Pennisi 93ecde9f3a Correct typo to improve coverage
Prior to this commit, the modified test included two different
expressions in positions that were meant to describe the same
expression. This meant that the value of the intended expression was
only partially verified.

Correct the test to fully verify the value of the expression.
2021-09-16 16:34:28 -04:00
Mike Pennisi 4a7830beec Remove TCO tests invalidated by normative change
Normative: Define default constructors using spec steps
https://github.com/tc39/ecma262/pull/2216

Resolves https://github.com/tc39/test262/issues/2978
2021-09-07 17:51:10 -04:00
rwaldron 85aa16c4c0 Generate tests 2021-08-19 11:52:55 -04:00
André Bargull d00039593d Add various private field and private method tests
This adds tests for implementation bugs in SpiderMonkey [1], plus
additional tests for implementation bugs in V8 and JSC.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1723155
2021-08-04 15:06:38 -04:00
rwaldron 8afbeda683 chore: migrate $ERROR -> throw new Test262Error in test/language/expressions/assignment/white-space.js 2021-07-29 15:21:12 -04:00
Rick Waldron 64a4b76c62
chore: migrate $ERROR -> throw new Test262Error in test/language/e* (#3098) 2021-07-28 13:48:39 -07:00
rwaldron 77cc528526 Generate tests 2021-07-22 15:31:36 -04:00
devsnek 80678e0bed Update identifier-strict-recursive.js 2021-07-20 10:33:29 -04:00
devsnek 2be28ba0c8 add test that delete early error is recursive 2021-07-20 10:33:29 -04:00
Mike Pennisi 3b06fd012a Update test for deletion of SuperProperty
The following proposed change modifies the semantics this test was
originally written to verify:

Normative: Allow null or undefined in Reference Records
https://github.com/tc39/ecma262/pull/2267
2021-07-19 13:28:09 -04:00
jugglinmike afe217b318
Add tests for "Class Static Init. Blocks" proposal (#2968)
* Add tests for "Class Static Init. Blocks" proposal

This proposal is currently at "stage 3" in TC39's standardization
process.

* fixup! Add tests for "Class Static Init. Blocks" proposal

* Correct identifier reference

* Update tests for grammar

* Update tests for identifiers

* Add tests for scope derivation
2021-07-15 08:49:12 -04:00
Mike Pennisi 9b4ca4371b Add tests for change in Reference Records
These tests support the following normative change

"Normative: Allow null or undefined in Reference Records"
https://github.com/tc39/ecma262/pull/2267

The tests concerning the `delete` operator increase coverage to verify
behavior which, though related, is not altered by the normative change.
These tests are intended to guard against regressions as engines
implement the new semantics.
2021-06-24 13:16:43 -04:00
Mike Pennisi 93541f09e2 Test sequence during deletion of SuperProperty 2021-06-24 13:15:34 -04:00
Michael Dyck 675cad4aa3 Remove leading spaces from "---*/" line 2021-06-10 12:03:05 -04:00
Mike Pennisi d454b8389b Move some AnnexB tests per proposed spec change
Additionally, update test metadata and introduce two new tests to
complete coverage.

Reference: "Normative: Make B.1.{1,2} normative"
https://github.com/tc39/ecma262/pull/1867
2021-05-21 13:06:41 -04:00
Mike Pennisi 5ae04619a9 Generate tests 2021-05-14 11:04:29 -04:00
Mike Pennisi 18834b2e19 Add tests for import assertions 2021-05-14 11:04:29 -04:00
Mike Pennisi 9b622bf093 Remove or relocate misleading tests
These tests were designed to test the built-in "Promise.race Resolve
Element function," but ECMA262 does not describe such a function.

Contrary to the test's description, the function under test is created
by the InstantiateArrowFunctionExpression abstract operation. The
following tests verify most of the details directly (only the function
object's extensibility was not already tested by the existing tests):

- test/language/expressions/arrow-function/name.js
- test/language/expressions/arrow-function/throw-new.js
- test/language/expressions/arrow-function/prototype-rules.js

The definition of the built-in resolving functions is closely related,
but Test262 already includes tests for the corresponding concerns:

- test/built-ins/Promise/resolve-function-extensible.js
- test/built-ins/Promise/resolve-function-name.js
- test/built-ins/Promise/resolve-function-nonconstructor.js
- test/built-ins/Promise/resolve-function-prototype.js

Remove the tests and introduce one additional test to preserve coverage
while improving discoverability.
2021-05-11 17:36:28 -04:00
Mike Pennisi 3addcc4b04 Generate tests 2021-04-20 09:53:57 -04:00