Commit Graph

26 Commits

Author SHA1 Message Date
Mathias Bynens d7c8a12e68 Remove invalid line terminator tests (#2044)
https://github.com/tc39/test262/pull/2020#issuecomment-456581449
2019-01-23 13:56:03 -02:00
Mike Pennisi 3468dad291 Improve coverage for line terminators
Previous commits restructured the tests for line terminators and made
coverage gaps more apparent. Introduce new files to improve coverage.
2019-01-01 14:01:09 -05:00
Mike Pennisi 8175f6c05e Improve name of line terminator tests 2019-01-01 14:01:08 -05:00
Mike Pennisi 6b49b770d8 Refactor LT tests for parsers: token delimiters
The tests for the parsing of line terminators 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-01-01 13:48:58 -05:00
Mike Pennisi e515abfa0e Refactor LT tests for parsers: multi-line comment
The tests for the parsing of line terminators 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-01-01 13:48:58 -05:00
Mike Pennisi 0ec9dbe3b3 Refactor LT tests for parsers: single-line comment
The tests for the parsing of line terminators 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-01-01 13:48:57 -05:00
Mike Pennisi f9ffa71c56 Refactor LT tests for parsers: string
The tests for the parsing of line terminators 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.
2019-01-01 13:48:56 -05:00
Mike Pennisi 10fb23049e Refactor LT tests for parsers: RegExp
The tests for the parsing of line terminators 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.
2019-01-01 13:48:55 -05:00
Mike Pennisi 9f1d25c9e5 Remove duplicative tests
The behavior asserted by the removed tests is covered by other files.

- test/language/line-terminators/7.3-1.js duplicates
  test/language/line-terminators/S7.3_A1.3.js
- test/language/line-terminators/7.3-2.js duplicates
  test/language/line-terminators/S7.3_A1.4.js
- test/language/line-terminators/7.3-3.js duplicates
  test/language/line-terminators/S7.3_A3.3_T1.js
- test/language/line-terminators/7.3-4.js duplicates
  test/language/line-terminators/S7.3_A3.4_T1.js
- test/language/line-terminators/7.3-9.js duplicates
  test/language/line-terminators/S7.3_A6_T3.js
- test/language/line-terminators/7.3-10.js  duplicates
  test/language/line-terminators/S7.3_A6_T4.js
- test/language/line-terminators/S7.3_A1.1_T1.js duplicates
  test/language/line-terminators/S7.3_A1.1_T2.js
- test/language/line-terminators/S7.3_A1.2_T1.js duplicates
  test/language/line-terminators/S7.3_A1.2_T2.js
- test/language/line-terminators/S7.3_A3.1_T2.js duplicates
  test/language/line-terminators/S7.3_A3.1_T3.js
- test/language/line-terminators/S7.3_A3.2_T3.js duplicates
  test/language/line-terminators/S7.3_A3.2_T1.js
- test/language/line-terminators/S7.3_A3.3_T2.js duplicates
  test/language/line-terminators/S7.3_A3.3_T1.js
- test/language/line-terminators/S7.3_A3.4_T2.js duplicates
  test/language/line-terminators/S7.3_A3.4_T1.js
- test/language/line-terminators/S7.3_A4_T1.js duplicates
  test/language/line-terminators/S7.3_A3.1_T1.js
- test/language/line-terminators/S7.3_A5.1_T1.js duplicates
  test/language/line-terminators/S7.3_A5.1_T2.js
- test/language/line-terminators/S7.3_A5.2_T1.js duplicates
  test/language/line-terminators/S7.3_A5.2_T2.js
2019-01-01 13:38:43 -05:00
Mike Pennisi 23594b8179 Correct tests
These files were authored to test the effect of the carriage return
character, but that character was not present in the source text.

Insert the character as intended by the authors.
2019-01-01 13:38:31 -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 41110ab0d4 Correct tests for line terminators within comments
Four tests were documented as asserting the interpretation of line
terminators within multi-line comments, but the source code did not
actually demonstrate this condition.

Introduce new tests that demonstrate the intended functionality and
place them in the correct directory.
2018-11-07 10:12:59 -05: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
Richard Gibson 48b4aa66af Remove no-longer-valid tests 2018-05-07 16:58:42 -04: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 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 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
André Bargull 1f97345668 Replace runTestCase with assert.throws [test/language/] 2015-08-11 17:43:21 +02:00
André Bargull 4c582732d0 Replace runTestCase with assert helpers [test/language/line-terminators] 2015-08-06 18:33:54 +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
André Bargull 9a602905d7 Fix strict mode errors in language/{identifiers, line-terminators, white-space}
Make tests strict mode compatible by assigning result value to a separate variable.

Part of issue #35.
2015-05-08 17:33:33 +02:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00