Commit Graph

34 Commits

Author SHA1 Message Date
Rick Waldron 323233be54
chore: migrate $ERROR -> throw new Test262Error in test/language/l* (#3104)
Excludes test/language/line-terminators/*
2021-07-28 13:45:44 -07: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
Tooru Fujisawa e756399793 Add test for NumericLiteralSeparator after decimal point followed by DecimalDigit 2020-02-05 15:06:46 -05:00
Leo Balter 5116847aec Fix wording 2019-07-22 13:55:59 -04:00
Leo Balter c0d1182e18 Fix structure for numeric literal tests 2019-07-22 13:53:28 -04:00
Leo Balter 51d1abadce
Fix typo (#2246) 2019-07-19 16:01:10 -04:00
Leo Balter b6760c3cc0 Add tests for Numeric Separators not allowed in legacy octal and non octal literals 2019-07-19 13:59:00 -04:00
Mike Pennisi e0120fcbd6 Refactor literal tests for parsers
The tests for the parsing of literal values 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. Rename the files to make each test's purpose more clear.
2019-03-31 20:19:49 -04:00
Mike Pennisi 937d0b1df1 Remove redundant test
The production under test is also used in the following file:

test/language/literals/numeric/legacy-octal-integer-strict.js

That test expresses the syntax with literal source text, making it
useful for parsers. Remove this test in favor of the other.
2019-03-31 20:14:09 -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
Rick Waldron f578b8754f NumericLiteralSeparator: Update "early" => "parse" in negative tests. Fixes gh-1512 2018-06-07 22:44:03 -04:00
Steve Fink fab08ab7a2 Add test for numeric literal followed by identifier 2018-05-09 15:45:52 -07:00
Rick Waldron 12797840ae features: [numeric-separator-literal] 2018-02-08 11:13:54 -05:00
Leo Balter 53c00784b6 Revert "Revert "Tests for NumericSeparatorLiteral. Closes gh-1051" (#1188)"
This reverts commit 8422147c17.
2018-02-08 11:13:54 -05:00
André Bargull cbe12a53e1 Remove duplicate esids 2018-01-25 13:59:37 -05:00
Rick Waldron 3be781c92d Fix: es6id -> esid sec-additional-syntax-numeric-literals 2018-01-10 16:01:45 -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
Leo Balter 8422147c17 Revert "Tests for NumericSeparatorLiteral. Closes gh-1051" (#1188) 2017-08-21 11:54:21 -04:00
Rick Waldron 844e317ba6 Tests for NumericSeparatorLiteral. Closes gh-1051 2017-08-17 09:50:33 -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
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 24e774251a Test runtime errors with assertion utility method
Improve test consistency by using the `assert.throws` helper function to
assert runtime exceptions. Remove superfluous code.
2016-10-18 14:36:14 -04:00
jugglinmike f7a61edc6f Add tests for Annex B extns to numeric literals (#608) 2016-05-09 18:31:23 -04:00
Gorkem Yakin 26e6fd7c17 Convert binary integers to octal in octal integer tests 2015-09-30 08:54:45 -07:00
André Bargull 2d5e7e0d44 Replace runTestCase with assert helpers [test/language/literals] 2015-08-13 17:33:06 +02:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
Mike Pennisi 10e0d977ec Prefer explicit error checking where possible
The `negative` frontmatter tag expresses an expectation for the behavior
of the test file as a whole. The `assert.throws` helper function offers
more fine-grained control over expectations because it may be applied to
specific statements and expressions. This makes it preferable in cases
where it may be used (i.e. when the test body does not describe a syntax
error or early error).

Re-implement assertions for errors to use the `assert.throws` helper
function wherever possible.
2015-07-10 14:12:57 -04: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 3fb19f53dc Add tests for OctalIntegerLiterals 2015-06-12 16:06:52 -04:00
Mike Pennisi c273e30235 Add tests for BinaryIntegerLiterals 2015-06-12 16:06:52 -04:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00