Commit Graph

52 Commits

Author SHA1 Message Date
André Bargull ff81dccfc3 Use verifyProperty in language/statements tests 2023-09-13 16:05:40 +02:00
rwaldron 4a125f2f4e chore: migrate $ERROR -> throw new Test262Error in test/language/s* 2021-07-29 10:38:53 -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
Alexey Shvayka 9411d7fccc Array binding: add generated tests 2020-08-20 12:48:08 -04:00
Leo Balter ddfe24afe3 Regenerate tests 2019-08-05 10:54:37 -04:00
Leo Balter d73548b027 Generate tests 2018-12-21 15:47:01 -05:00
Leo Balter f7f845ce6f Update tests with DONOTEVALUATE 2018-11-14 09:19:15 -05:00
Leo Balter dec4e5df74
Merge pull request #1801 from mathiasbynens/issue-1634
Move `throw "…"` for negative parsing errors to a helper function
2018-11-13 17:23:09 -05:00
Mike Pennisi a7deb7bcce Add tests for `arguments` within function body 2018-10-28 16:23:38 -04:00
Mathias Bynens b9daa57dcb Rename to $DONOTEVALUATE per @leobalter's suggestion 2018-10-23 13:51:17 +02:00
Mathias Bynens e3feffb01e Move `throw "…"` for negative parsing errors to a helper function
Closes #1634.
2018-10-23 13:51:16 +02:00
Mike Pennisi aac38cb368 Normalize coverage for `var` declarations
Add tests to mirror similar tests which were authored previously.
2018-10-07 16:49:50 -04:00
Mike Pennisi b819c597ab Remove redundant test
This behavior is covered by another test in this directory:
`arguments-strict-single.js`. Although the syntax error happens to occur
within the body of a function expression, this distinction is not
significant enough to warrant the test's presence nor does it motivate
the introduction of many similar negative syntax tests which are
currently unavailable.
2018-10-07 16:49:49 -04:00
Mike Pennisi 6b00c8fbfe Rename and refactor tests
The tests for the parsing of variable declarations were expressed using
eval. This made the tests more complex than necessary and also prevented
the tests from providing value to ECMAScript parsers.

Remove the use of eval and instead express the expectations with literal
source text.
2018-10-07 16:49:49 -04:00
Mike Pennisi ceb79988ae Relocate and refactor tests
The tests for the parsing of `for/in` loops were expressed using eval.
This made the tests more complex than necessary and also prevented the
tests from providing value to ECMAScript parsers.

Remove the use of eval and instead express the expectations with literal
source text. Move the tests to the `for-in` directory to better reflect
the grammar production that they test.
2018-10-07 16:48:42 -04:00
Mike Pennisi 835c202b36 Remove redundant and irrelevant tests
Two tests placed within the "variable" directory do not include a variable
declaration. Because the behavior they assert is covered by an existing
test (test/language/arguments-object/10.5-1gs.js), they may be removed
without reducing coverage.
2018-10-07 16:43:08 -04:00
Leo Balter 46fcbf81d1 Generate tests 2018-09-26 09:18:46 -04:00
André Bargull f3911d7ae4 Update remaining tests to use 'parse' instead of 'early' error phase 2018-01-25 13:59:37 -05:00
Mike Pennisi 136110378b Rename negative test "phase" for parsing
Early errors may result from parsing the source text of a test file, but
they may also result from parsing some other source text as referenced
through the ES2015 module syntax. The latter form of early error is not
necessarily detectable by ECMAScript parsers, however. Because of this,
the label "early" is not sufficiently precise for all Test262 consumers
to correctly interpret all tests.

Update the "phase" name of "early" to "parse" for all those negative
tests that describe errors resulting from parsing of the file's source
text directly. A forthcoming commit will update the remaining tests to
use a "phase" name that is more specific to module resolution.
2018-01-05 15:17:50 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Mike Pennisi 025b44f38c Refactor AssignmentExpression tests for parsers
A number of tests for the parsing of the AssignmentExpression production
were expressed using `eval`. This made the tests more complex than
necessary, and also prevented the tests from providing value to
ECMAScript parsers.

Remove the use of `eval` in the relevant tests and instead express the
expectations with literal source text. Remove superfluous "onlyStrict"
restriction from tests by declaring the probe binding prior to
assignment.
2017-12-10 15:59:11 -05:00
Leo Balter b3092c61b6 Add generators flags for tests depending on generators features (#1259)
* Add missing generators feature flags

* Generate files

* Add generators flags

* fixup! Add generators flags
2017-10-04 16:12:34 -04:00
Leo Balter 9f526c0bcd Re-generate tests 2017-09-08 10:13:50 -04:00
Leo Balter 7630235d5d Re-generate tests 2017-09-08 10:13:36 -04:00
Rick Waldron dffbe50668 Generate tests 2017-08-16 15:11:44 -04:00
Mike Pennisi ef76e548a4 Re-generate tests 2017-06-28 11:24:36 -04:00
Mike Pennisi 81d00def42 Force "early error" tests to fail if evaluated
This pattern makes expectations more explicit by making test files more
literal.
2017-06-28 11:24:36 -04:00
Rick Waldron 2dd8e8b2c4 Throw away tests
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-06-23 13:21:39 -04:00
Leo Balter 5f04d2b1f3
Generate tests 2017-05-10 14:08:35 -04:00
Mike Pennisi 2c0c3e7f96 Correct typo in copyright information 2017-04-18 12:23:22 -04:00
Leo Balter 2adebecbfa
Generate tests 2017-03-27 13:21:14 -04:00
Leonardo Balter 0cc55bb44d
Generate tests 2017-03-06 16:25:14 -05:00
Mike Pennisi ade6d2e384 Remove "NotEarlyError" object
Because expectations regarding error "phase" are now expressed via test
meta-data, the test runner may now enforce this requirement on negative
tests.

Remove the "NotEarlyError" from the project source. This reduces the
amount of domain knowledge required to author tests and lessens the
potential for inconsistencies between tests.
2016-10-19 15:24:22 -04:00
Mike Pennisi 7d4b1d28ae Re-format tests for SyntaxErrors
Authored via the following command:

   $ find test -type f -print0 | \
       xargs -0 sed \
         -i 's/^\(\s*\)negative:\s*SyntaxError\s*$/\1negative:\n\1  phase: early\n\1  type: SyntaxError/g'
2016-10-19 15:24:21 -04:00
Mike Pennisi cdc62ce0fa Re-generate tests 2016-10-19 15:24:20 -04:00
Tom Care 163fae3e68 Merge pull request #715 from bocoup/audit2016-section-13
Improve coverage for section 13, "Statements and Declarations"
2016-07-12 13:51:15 -07:00
jugglinmike 2bfaa0d895 Improve coverage for class "name" inference (#718)
* Extend tests for class "name" inference

Ensure that when a class defines a static "name" method, that method
definition prevents the "name" inference behavior.

* Re-generate tests
2016-07-08 18:37:04 -07:00
Mike Pennisi ec9d79c027 Add missing tests for statement completion values
The project contains tests for the completion value of most (but not
all) statements. Introduce tests to complete coverage of this detail.
2016-06-30 15:24:41 -04:00
Mike Pennisi 843d14ec48 Add test for order of operations in "var" stmnt 2016-06-30 15:03:29 -04:00
Mike Pennisi d4b263ccbb Generate tests 2016-05-10 11:57:37 -04:00
Mike Pennisi 73a7e23061 Re-generate tests 2016-04-26 16:13:32 -04:00
Mike Pennisi 74bff6b3d5 Add initial set of generated test sources 2016-03-16 15:29:30 -04:00
André Bargull ee8a222125 Replace runTestCase with assert helpers [test/language/statements] 2015-08-13 17:33:42 +02:00
André Bargull 7f55f60b5f Replace runTestCase with assert.throws [test/language/statements] 2015-08-11 17:43:01 +02:00
André Bargull 3c3e0a6adb Replace runTestCase with assert helpers [test/language/statements/] 2015-08-06 18:33:10 +02:00
Mike Pennisi 2fe074134a Add tests for function `name` attribute
This change set includes tests for most invocations of the
SetFunctionName abstract operation in the ES2015 specification.
Practical testing considerations preclude the introduction of tests for
certain invocations:

- The project is still vetting methods to sustainably test the semantics
  of the Destructuring Binding pattern across all valid productions.
  - 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
  - 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
- Without a loader, there is no way to access a function object declared
  in an ExportDeclaration, so `name` assignment cannot be tested in
  these cases
  - 14.1.19 Runtime Semantics: InstantiateFunctionObject
  - 14.4.12 Runtime Semantics: InstantiateFunctionObject
  - 14.5.15 Runtime Semantics: BindingClassDeclarationEvaluation
  - 15.2.3.11 Runtime Semantics: Evaluation
2015-07-21 20:05:34 -04:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
Mike Pennisi 29ecced632 Update handling of directive prologues
Some tests specifically concern the application of the `use strict`
directive as it appears in JavaScript source code. These tests should
*not* be run with the `onlyStrict` flag because relying on the test
runner to enable strict mode makes the semantics of the source code
irrelevant. Update these tests to use the `noStrict` flag.

Other tests concern language semantics that are only valid in strict
mode, but the mechanism for enabling strictness is inconseqential.
Update these tests to use the `onlyStrict` flag and remove any redundant
`use strict` directive prologues contained within.

Still other tests are valid both within and outside of strict mode.
In keeping with the majority of other tests, do not specify any
restrictions on the environments in which these tests may be run.
2015-06-18 17:38:34 -04:00
Mike Pennisi 57f3466cf7 Fix tautological pattern in tests
In neglecting to assert the type of error thrown (or that any error was
thrown at all), these tests cannot fail. Refactor the tests to use the
`assert.throws` helper method, which takes these details into
consideration.
2015-06-16 12:55:56 -04:00
André Bargull 15cc639131 Strict eval variable declarations are lexically scoped, assign expected result value to a previously declared global (issue #35)
Add missing variable declarations (issue #35)

Split S12.6.3_A10 and S12.6.3_A10.1 because both files seem to test implicit global variables (issue #35)

Changes (issue #35)

- Add missing noStrict flags.
- Change 13.2-15-1 and 13.2-18-1 to use assert.js and propertyHelper.js (simplifies writable and configurable checks while in strict mode).
- Add variable declarations for globals.
- Create copies of S13.2.1_A6_T1 and S13.2.1_A6_T2 instead of adding variable declarations, because both files seem to test implicit global variables.
- Split S13_A14 and S13_A16 to work in strict mode.
- Remove assignment to .name property.

Add missing noStrict flags (issue #35)

Add missing noStrict flags and variable declarations (issue #35)

Add missing noStrict flags (issue #35)
2015-04-08 15:54:58 -07:00