Commit Graph

1062 Commits

Author SHA1 Message Date
Mike Pennisi 3b3bd06819 Add tests for Lexical Environment management
Add tests that assert the management of the running execution context's
LexicalEnvironment and VariableEnvironment components, as created by the
following abstract operations:

- NewDeclarativeEnvironment
- NewObjectEnvironment
- NewFunctionEnvironment

Many tests require the use of non-strict direct eval, meaning they may
not be run in strict mode. This does not effect coverage because the
semantics in these cases are not observable from strict mode code.

Some situations require the creation of a binding, but this binding has
no relevance to the test itself. In these cases, use names consisting
solely of the underscore character (`_`).

Avoid the use of Block statements wherever possible, as these trigger
the creation of additional environments which may interfere with the
behavior under test.
2016-04-28 09:44:41 -04:00
Leonardo Balter 9c45e2ac68 Revert "Add `System.global` tests (#567)"
This reverts commit 45e5fc8889.
2016-04-27 14:25:15 -04:00
Mike Pennisi 73a7e23061 Re-generate tests 2016-04-26 16:13:32 -04:00
Gorkem Yakin 84d95077d0 Merge branch 'bocoup/ta-foreach-map-update' 2016-04-26 09:26:03 -07:00
Leonardo Balter afd44fc87a Update tests for TypedArrays foreach and map
Based on the feedback from gh-593
2016-04-26 09:23:58 -07:00
Gorkem Yakin 85e6ab8e15 Merge branch 'bocoup/species-accessor-values' 2016-04-25 16:59:44 -07:00
Mike Pennisi b8e40a6f3f Add tests for return value of @@species accessors 2016-04-25 16:59:23 -07:00
Gorkem Yakin 851be6108a Merge branch 'bocoup/ta-subarray' 2016-04-25 16:53:20 -07:00
Leonardo Balter 1f9cc0b0c0 Add tests for TypedArrays subarray 2016-04-25 16:52:20 -07:00
Gorkem Yakin f6475d81bf Merge pull request #543 from bocoup/enumerable-helper
Fix verifyEnumerable helper to account for properties with Symbol values
2016-04-25 16:32:53 -07:00
Mike Pennisi 784824895d Extend coverage for eval code
Closes #572

Introduce tests for new semantics for ES2015 features such as
lexically-scoped bindings. Also add tests for semantics defined in prior
editions of the specification but not yet covered in this test suite.
2016-04-25 16:43:48 -04:00
Mike Pennisi 2872537136 Add equivalent tests for eval code
For each test that asserts the behavior of either "direct" or "indirect"
eval (but not both), introduce an equivalent test for the opposite case.
2016-04-25 16:36:41 -04:00
Mike Pennisi 364d6433e2 Refactor tests for eval code
Some tests asserted behavior for both "direct" eval and "indirect" eval.
Split these assertions across files dedicated for each use case.
2016-04-25 16:36:39 -04:00
Mike Pennisi 7630e1763d Re-organize tests for eval
Limit tests in `language/expressions/call/` and `built-ins/eval/` to
only assert details that are directly related to the invocation pattern.
Re-organize all other tests within the `language/eval-code/` directory,
further categorizing each as `direct` or `indirect` as appropriate.
Remove the extraneous "executable" flag from those files which carried
it.
2016-04-25 16:36:36 -04:00
Gorkem Yakin 7f88f29328 Merge branch 'bocoup/global-object' 2016-04-25 11:09:49 -07:00
Mike Pennisi eb644bb2da Reduce reliance on `fnGlobalObject.js`
This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
2016-04-25 11:09:21 -07:00
Gorkem Yakin 562133f4ba Merge branch 'bocoup/symbol-cleanup' 2016-04-25 10:59:48 -07:00
Mike Pennisi 3d68fcc063 Increase coverage for Symbol constructor
Add new tests for invocation requirements; re-organize existing files
according to the language feature under test.
2016-04-25 10:59:22 -07:00
Gorkem Yakin 35c00cab92 Merge branch 'bocoup/ta-every-some' 2016-04-25 10:46:38 -07:00
Leonardo Balter 45ff661f75 Add tests for TypedArrays some 2016-04-25 10:46:22 -07:00
Leonardo Balter 3339406dd7 Add tests for TypedArrays every 2016-04-25 10:46:16 -07:00
Gorkem Yakin a4fd0dc8f4 Merge branch 'bocoup-ta-interoperability' 2016-04-25 10:37:06 -07:00
Leonardo Balter 866626500c Update tests for TypedArrays/DataView non-interoperable get accessor methods
Fixes gh-582
2016-04-25 10:36:50 -07:00
Gorkem Yakin c26ef14ae0 Merge branch 'bocoup/ta-indexof' 2016-04-25 10:32:22 -07:00
Leonardo Balter d1f02d0fb8 Add tests for TypedArrays lastIndexOf 2016-04-25 10:31:42 -07:00
Leonardo Balter d46b0b1860 Add tests for TypedArrays indexOf 2016-04-25 10:31:38 -07:00
Gorkem Yakin a432cde542 Merge pull request #534 from mythrialle/master
Removes special handling for UTC timezone in toISOString/15.9.5.43-0-1…
2016-04-25 10:02:19 -07:00
Mythri 664ec78fcc Moves Date constructor outside of assert, so that it actually tests toISOString 2016-04-25 16:45:03 +01:00
Leonardo Balter bc0a40c51c Add tests for TypedArrays findIndex 2016-04-25 11:43:19 -04:00
Mythri 679d02a6ed Fixed comments 2016-04-25 15:43:55 +01:00
Leonardo Balter 9aa4dced8d Add tests for TypedArrays find 2016-04-22 10:34:30 -04:00
Leonardo Balter bc8ae6e0ae Fix test for TypedArray.prototype.forEach 2016-04-21 17:22:55 -04:00
jugglinmike ba3dacbe5a Correct tests for native functions' toString value (#580)
Modify the regular expression for native functions' toString value to
satisfy all test cases. Correct the test file's reference to the harness
file. Re-format the test file's assertions to aid debugging in the event
of failure.
2016-04-21 15:55:54 -04:00
jugglinmike 38329a7038 Add tests for TryStatement binding restrictions (#577)
This changeset includes tests for early errors and those generated
dynamically by eval. It also accounts for relevant AnnexB extensions.
2016-04-21 15:54:25 -04:00
Leonardo Balter 88f390d189 Add tests for TypedArrays copyWithin 2016-04-20 14:08:33 -04:00
Leonardo Balter 5e8b661050 Add tests for TypedArrays fill 2016-04-20 14:05:38 -04:00
jugglinmike cf68c3be91 Correct invalid tests for the Date constructor
The millisecond representation of a given Date instance is dependent on
the local system's time zone settings. In order to pass consistently
across contexts, tests for this value must take the system configuration
into account.

Introduce a test harness utility function to encapsulate these concerns.
Re-use this function across all test files that assert the exact
millisecond representation of Date instances.
2016-04-19 17:00:59 -04:00
Leonardo Balter 04a3c28f7d Add tests for conversion operations on TypedArrays 2016-04-19 12:18:52 -04:00
Mike Pennisi b698c8b3ab Add tests for Math constants
Closes gh-540

Because the specific value of each constant is specified as a
host-defined approximation, only the value type may be enforced by
Test262.
2016-04-18 14:39:37 -04:00
Mike Pennisi f7aa31b41f Remove over-specified tests
Except for a small set of expected input/output pairs, both ES5 and
ES2015 define the expected return value of these methods in terms of an
"implementation-dependent approximation." This makes it inappropriate to
enforce expectations for specific values, even if expressed imprecisely.
2016-04-18 14:36:49 -04:00
jugglinmike 26676beab5 Add tests for IteratorClose in dstr assignment (#524)
The files in this patch are organized according to the following naming
scheme:

Prefix             | Grammar production
-------------------|-------------------
`array-empty-`     | ArrayAssignmentPattern : [ ]
`array-elision-`   | ArrayAssignmentPattern : [ Elision ]
`array-rest-`      | ArrayAssignmentPattern : [ Elisionopt AssignmentRestElement ]
`array-elem-`      | ArrayAssignmentPattern : [ AssignmentElementList ]
`array-elem-trlg-` | ArrayAssignmentPattern : [ AssignmentElementList , Elisionopt AssignmentRestElementopt ]

Suffix             | Intent
-------------------|-------
`-abpt-close-err`  | The assignment evaluation returns an abrupt completion, and the iterator's `return` method throws an error
`-abpt-close-skip` | The assignment evaluation returns an abrupt completion, but IteratorClose is not invoked
`-abpt-close`      | The assignment evaluation returns an abrupt completion, and IteratorClose is invoked as specified
`-get-err`         | Abrupt completion returned from GetIterator
`-nrml-close-err`  | The assignment evaluation completes, and the iterator's `return` method throws an error
`-nrml-close-null` | The assignment evaluation completes, and the iterator's `return` method returns a non-Object value (there is no corresponding `-abpt-` suffix because the algorithm does not reference the return value in those cases)
`-nrml-close-skip` | The assignment evaluation completes, but IteratorClose is not invoked
`-nrml-close`      | The assignment evaluation completes, and IteratorClose is invoked as specified

Not all suffixes are appropriate for all productions. Suffixes have been
simplified in cases where less specificity is necessary to disambiguate
test cases.
2016-04-18 14:33:21 -04:00
dtig 20d37a6f2f Add SIMD test suite and utility functions (#442) 2016-04-18 14:26:15 -04:00
jugglinmike c230b7f307 Add tests for RegExp literal early errors (#566) 2016-04-18 13:36:43 -04:00
jugglinmike a068f19f06 Streamline redundant `eval` tests (#570)
Some tests for `eval` assert the equality of key enumeration on the
global object, comparing the ordering when the object is referenced
through eval.

Based on the test bodies and the "info" field in their metadata, these
tests appear to have been written under the mistaken impression that
erroneous creation of an environment record would be observable through
the `this` value.

In reality, the value in such cases resolves to the global object. That
renders these tests redundant and overly complex--none of the
distinctions between each test actually demonstrates a different
behavior.

Remove the redundant tests and introduce three new tests asserting the
correct resolution of the `this` keyword for direct eval code from
within the global scope and from within function scope.
2016-04-18 13:35:03 -04:00
Leo Balter 3723e7caeb Merge pull request #545 from bocoup/generation
Introduce test generation tool
2016-04-15 17:56:36 -04:00
Leonardo Balter e7f6cd7f86 assert.throws fails if second argument is not a function 2016-04-15 10:14:54 -04:00
Leonardo Balter e451026965 Fix minor typo on a test for Array#fill 2016-04-12 19:48:54 -04:00
Leonardo Balter f3cc1fb983 Add tests for TypedArrays map 2016-04-12 15:41:38 -04:00
Leonardo Balter e01371e12a Add tests for TypedArrays forEach 2016-04-12 15:41:34 -04:00
Jordan Harband 45e5fc8889 Add `System.global` tests (#567) 2016-04-12 14:37:10 -04:00