Commit Graph

180 Commits

Author SHA1 Message Date
Rick Waldron a2554d909b Merge branch 'remove-runTestCase-builtins-other' of https://github.com/anba/test262 into anba-remove-runTestCase-builtins-other
# By André Bargull
# Via André Bargull
* 'remove-runTestCase-builtins-other' of https://github.com/anba/test262:
  Replace runTestCase with assert helpers, rest [test/built-ins]
  Replace runTestCase with assert helpers [test/built-ins]

Conflicts:
	test/built-ins/Array/from/S22.1.2.1_T1.js
	test/built-ins/Array/from/S22.1.2.1_T2.js
	test/built-ins/Array/from/S22.1.2.1_T3.js
2015-09-04 13:25:41 -04:00
Leonardo Balter 73409cea4e Add tests for default parameters 2015-09-02 18:01:51 -04:00
Gorkem Yakin c04984872d Merge pull request #370 from bocoup/symbol-has-instance
Add tests for well-known Symbol, @@hasInstance
2015-08-31 16:32:55 -07:00
Brian Terlson c4231d4948 Merge pull request #420 from bakkot/patch-1
Wrong error message in function-code/S10.2.1_A1.js
2015-08-24 15:25:32 -07:00
Kevin Gibbons 69969e16b1 Remove extraneous indent in header, for consistency 2015-08-24 15:24:10 -07:00
Kevin Gibbons 8759c88bec Wrong error message in function-code/S10.2.1_A1.js 2015-08-18 17:47:02 -07:00
André Bargull 1b14708467 Replace runTestCase with assert helpers [test/built-ins] 2015-08-13 17:50:58 +02:00
André Bargull 1f97345668 Replace runTestCase with assert.throws [test/language/] 2015-08-11 17:43:21 +02:00
André Bargull 7f55f60b5f Replace runTestCase with assert.throws [test/language/statements] 2015-08-11 17:43:01 +02:00
André Bargull 3de484fe83 Replace runTestCase with assert.throws [test/language/expressions] 2015-08-11 17:42:41 +02:00
André Bargull d45d495ee6 Replace runTestCase with assert helpers [test/language/function-code] 2015-08-06 18:34:38 +02:00
André Bargull f939067d0e Replace runTestCase with assert helpers [test/language/future-reserved-words] 2015-08-06 18:34:15 +02:00
André Bargull 4c582732d0 Replace runTestCase with assert helpers [test/language/line-terminators] 2015-08-06 18:33:54 +02:00
André Bargull 31f027dc03 Replace runTestCase with assert helpers [test/language/types] 2015-08-06 18:33:32 +02:00
André Bargull 3c3e0a6adb Replace runTestCase with assert helpers [test/language/statements/] 2015-08-06 18:33:10 +02:00
André Bargull 713df280e5 Replace runTestCase with assert helpers [test/language/statements/for] 2015-08-06 18:32:38 +02:00
André Bargull efabdf8474 Replace runTestCase with assert helpers [test/language/expressions/] 2015-08-06 18:32:15 +02:00
André Bargull c7e160084c Replace runTestCase with assert helpers [test/language/expressions/object] 2015-08-06 18:31:44 +02:00
André Bargull 4eac0d909e Replace runTestCase with assert helpers [test/language/expressions/delete] 2015-08-06 18:31:06 +02:00
André Bargull ba8a41efe9 Replace runTestCase with assert helpers [test/language/arguments-object] 2015-08-06 18:30:42 +02:00
Mike Pennisi 652e35bd32 Add tests for well-known Symbol, @@hasInstance
Assert the behavior of the built-in method on the FunctionPrototype and
the usage of the Symbol by the `instanceof` operator.
2015-07-28 00:08:55 -04:00
Mike Pennisi 9068608ab7 Add tests for RegExp `u` flag 2015-07-24 14:43:20 -04: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
Brian Terlson 7992be11ed Merge pull request #386 from anba/issue-383/test-failures
Fix test regressions
2015-07-17 13:06:38 -07:00
Brian Terlson 2284a46ebf Merge pull request #385 from anba/license
Change license headers to standard format
2015-07-17 11:03:07 -07:00
André Bargull 023c7aa69e - Remove inline license
- Remove duplicate word
- Add missing license
2015-07-17 19:55:00 +02:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
André Bargull 85b248844d Fix test regressions
- Add missing 'negative: ReferenceError' in S7.9_A5.7_T1
- Remove stale 'negative: ReferenceError' in block-local-closure-get-before-initialization
- Remove all tail-call expressions in test/built-ins/Function
- And update code in test/built-ins/Function to simply use 'f()' instead of 'var r = f(); return r'

Fixes #383
2015-07-17 17:31:26 +02:00
Brian Terlson 13ebbebfd6 Merge pull request #360 from bocoup/negative-reform
Negative reform
2015-07-16 15:31:22 -07:00
Thomas Wood b10f06ada3 Fix 11.13.1-4-29gs.js incorrect comment explanation
SyntaxError => TypeError for writing to a non-writeable field.

Fixes #372
2015-07-15 20:32:47 +01: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 6646d3e94f Re-organize class tests
The `test/language/class/` directory contains a small subset of
Test262's tests for ES2015 classes. The majority of tests for classes
are organized within `test/language/statements/class/`.

- Move the tests that rely on the ClassDeclaration syntactic form from
  `test/language/class/` to `test/language/statements/class/`.
- Move the test that relies on the ClassExpression syntactic form from
  `test/language/class/` to `test/language/expressions/class/`.
2015-07-10 10:36:05 -04:00
Brian Terlson 0622faca9d Merge pull request #329 from bocoup/unicode-escape-identifiers
Unicode escape identifiers
2015-07-09 16:00:00 -07:00
Mike Pennisi e0d59b0ede Add tests for Unicode escape sequences
- Re-organize existing tests for identifiers
  Name files according to their content (not their ES5 ID). Move tests
  for IdentifierName and LabelIdentifier to more appropriate directories.
- Simplify and correct tests
  Instead of asserting successful runtime evaluation using `eval`, rely
  on the test runner's ability to detect syntax errors. Update the test
  bodies to test the grammar referenced by their ES5 ID and
  description--the IdentifierStart pattern.
- Use `negative` frontmatter to assert SyntaxErrors
- Remove redundant tests
- Use `assert.equal` helper function
- Add equivalent tests for literal unicode chars
- Add tests for variable-length unicode escape
2015-07-09 18:52:22 -04:00
Mike Pennisi 03e862ee14 Re-organize generator tests
The `test/language/generators/` directory contained a single file that
concerned generators derived both from syntactic form and from a
built-in function.

Refactor this test into two files and place each in the appropriate
directory.
2015-07-09 15:07:19 -04:00
Brian Terlson d9f1758ef4 Merge pull request #340 from bocoup/raw
Implement `raw` flag
2015-07-07 14:35:11 -05:00
Mike Pennisi ab7617dedd Implement `raw` flag
Some tests involving the directive prologue are invalidated by source
text transformations that insert executable code in the beginning of the
script. Implement a `raw` flag that allows these tests to opt-out of
this transformation. Update the relevant tests to use this flag (and
remove references to globals only available when code is injected).

Update the Python runner accordingly:

- Do not run tests marked as "raw" in strict mode
- Reject invalid test configurations

Update the browser runner accordingly:

- Do not modify the script body of tests marked as "raw"
2015-07-07 13:18:55 -04:00
Brian Terlson 6f22dad152 Merge pull request #316 from bocoup/template-more
Improve tests for templates
2015-07-06 17:30:34 -05:00
Mike Pennisi 64826c2ad3 Make tests more strict
In ECMAScript 5, assignment to a non-reference value throws a runtime
ReferenceError. ECMAscript 6 specifies an early ReferenceError in these
cases. Tests for this behavior have been authored to pass in both cases.
Simplify these tests to describe and assert the early error.
2015-06-29 12:25:01 -04:00
Brian Terlson 20d39432b9 Merge pull request #337 from bocoup/remove-fn-exists
Remove unnecessary "include" file
2015-06-26 11:02:45 -07:00
Mike Pennisi f8e18ccd76 Remove unnecessary "include" file
The `fnExists` function defines a generic way to determine if any number
of values are function instances. Because it is only used by a single
test, the additional complexity required by the generalized code (and
the organizational drawbacks to maintaining another "include" file) are
not justified. Remove the file and update the test to assert the
function's existence directly.
2015-06-26 12:34:04 -04:00
Brian Terlson e4a25da86a Merge pull request #305 from jugglinmike/browser-only-strict
Update browser runner to honor `onlyStrict` flag
2015-06-25 14:44:34 -07: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 6231fe20a4 Re-write test body to match test description 2015-06-18 17:38:33 -04:00
Mike Pennisi fabf5f3320 Correct typo in test descriptions 2015-06-18 17:38:33 -04:00
Mike Pennisi ef1fddd533 Fix invalid tests 2015-06-18 17:38:33 -04:00
Mike Pennisi 92a735dad7 Create distinct tests for arguments object types 2015-06-18 16:01:49 -04:00
Mike Pennisi 03f8ca8336 Move `for-of` tests to appropriate directory 2015-06-18 15:53:24 -04:00
Mike Pennisi a321e87a2d Add tests for `for..of` iteration over built-ins 2015-06-18 15:53:19 -04:00
Brian Terlson 42d16da901 Merge pull request #286 from bocoup/obj-method-def
Add tests for MethodDefinition forms new to ES6
2015-06-17 19:56:29 -04:00