Commit Graph

56 Commits

Author SHA1 Message Date
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
Leonardo Balter 813bb5166c
Remove precision-equivalency tests
Due to specs approximation values, some tests are invalid as the harness
helpers rely on another approximated values as Math.LN2.
2016-06-20 17:44:11 -04:00
Leonardo Balter bc42c6ab5c Add harness for byte conversion values
Update testTypedArrayConversions to require byteConversionValues
2016-05-25 10:10:50 -04:00
jugglinmike b17ffc0298 Add tests for NaN handling with Typed Arrays (#623)
Ensure that NaN values are canonicalized consistently by all invocations
of SetValueInBuffer. Also ensure that `%TypedArray%.prototype.set` and
`%TypedArray%.prototype.slice` preserve the bit-level encoding of the
source data.

Use a set of experimentally-derived expressions known to produce NaN
values with distinct bit patterns in various platforms.
2016-05-12 10:16:03 -04: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
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 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
dtig 20d37a6f2f Add SIMD test suite and utility functions (#442) 2016-04-18 14:26:15 -04:00
Leonardo Balter e7f6cd7f86 assert.throws fails if second argument is not a function 2016-04-15 10:14:54 -04:00
Michael Ficarra 6b7cbb5035 add Function.prototype.toString tests, conforming to proposed revision
See the proposal at
https://tc39.github.io/Function-prototype-toString-revision/
2016-04-11 14:39:12 -04:00
Leonardo Balter 70c7375be8 Add harness/detachArrayBuffer.js 2016-03-22 17:00:01 -04:00
Leonardo Balter a93ef42b56 Fix verifyEnumerable helper to account for Symbol properties 2016-03-15 10:13:52 -04:00
Jordan Harband a6fad62d7c Last minute fixes 2016-02-19 11:27:31 -08:00
Jordan Harband 6f05b008dc Encapsulate helper function's helper function 2016-02-17 15:01:26 -08:00
Jordan Harband d530c87b41 Create `proxyTrapsHelper` to throw on all traps by default. 2016-02-13 15:56:47 -08:00
Gorkem Yakin dbcc8cadf3 Merge pull request #507 from bocoup/remove-unused-file
Remove unused harness file
2016-02-12 17:16:01 -08:00
Leonardo Balter 4388f2869c Allow call testWithTypedArrayConstructors with a constructors subset 2016-02-12 16:02:36 -08:00
Mike Pennisi 071b5f03c6 Remove unused harness file
The harness file `Test262Error.js` has not contained executable code since it
was introduced in this project [1]. The definition of the `Test262Error`
function has consistently been located in the `sta.js` harness file which test
runners are expected to inject into the test environment.

Remove the file and all references to it.

[1] See commit c33bf0e043
2016-02-12 13:44:18 -05:00
Mike Pennisi 4dc81d3788 Add tests for tail-call optimization
ECMAScript 2015 introduced tail call optimization for function calls
occuring in a number of positions in the grammar. Assert expected
behavior by triggering a large (but configurable) number of recursive
function calls in these positions. Compliant runtimes will execute such
programs without error; non-compliant runtimes are expected to fail
these tests by throwing an error or crashing when system resources are
exhausted.
2016-02-01 13:20:17 -05:00
André Bargull 42edfd6e89 Add missing tests for "length" and "name" properties of %TypedArray% built-in functions 2016-01-15 18:12:42 +01:00
André Bargull b62dccf1dc Add test cases for recent ES2016 fixes
- lastIndex in RegExp.prototype[Symbol.split]: tc39/ecma262@08b4756747
- Missing number conversion in DataView.prototype.setXXX: tc39/ecma262@4f875fe96d
- Negative zero byteoffset in TypedArray: tc39/ecma262@2d1ed20db7
- EvalDeclarationInstantiation throws TypeError: tc39/ecma262@2be6968715
- BindingRestElement allows BindingPattern: tc39/ecma262@d322357e6b
- Eval in parameters with computed property keys: tc39/ecma262@04e2e9b719
- Use strict with non-simple parameters: tc39/ecma262@15b0db41ed
- __proto__ in strict mode: tc39/ecma262@5c1984334d
2015-12-15 17:33:49 +01:00
André Bargull 9a3f810465 Remove harness/runTestCase.js 2015-08-13 18:13:45 +02:00
Leonardo Balter e1ec3c29b3 Fix missing variable declaration
Fixes #405
2015-08-05 20:04:02 -04:00
Brian Terlson 8870e7bf34 Merge pull request #394 from smikes/quoted-sameValue-strings
Use guillemets («») to quote string values - fixes #174
2015-08-05 11:20:18 -07:00
smikes 4a6f28f075 Use guillemets («») to quote string values - fixes #174
Expected/actual values should be delimited in a way that
isn't confusable with actual string quotes " '
2015-07-30 20:13:49 -06:00
Brian Terlson eea8807d40 Merge pull request #355 from anba/regexp-unicode
B.1.4 and Unicode RegExps
2015-07-30 15:31:16 -07:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
André Bargull d5075819e9 Check resolved time zone is valid 2015-07-08 19:13:55 +02:00
André Bargull a4205bac61 B.1.4 extensions are not allowed for Unicode RegExps 2015-07-08 17:19:59 +02: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
Brian Terlson 9abed155e3 Merge pull request #338 from bocoup/move-web-scripts
Move web scripts
2015-06-26 10:58:59 -07:00
Brian Terlson 9dc49b72cc Merge pull request #336 from bocoup/remove-env
Remove empty "include" file
2015-06-26 10:57:59 -07:00
Mike Pennisi b974c13751 Move website scripts to a dedicated directory
Some JavaScript source files are only relevant in the context of the
Test262 website. They should not be explicitly included by individual
tests, so their presence in the `harness/` directory alongside "include"
files is misleading.

Move the scripts to a location within the `website/` directory to
better-reflect their intended use. Update the relevant HTML templates
with the new locations.
2015-06-26 13:29:07 -04:00
Mike Pennisi 86c7e272a6 Remove support for legacy `$INCLUDE` syntax
Although test files once expressed dependencies on external files using
a global `$INCLUDE` function, that pattern was removed in favor of
declarative meta-data [1].

Remove the associated logic from the Python runner and the browser.

[1] See commit d4354d14d5.
2015-06-26 13:29:07 -04: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
Mike Pennisi e57da7a8f1 Remove empty "include" file
The `environment.js` file has been empty since its initial introduction
to this project [1]. It has no effect on any of the contexts in which it
is currently referenced, so it may be safely removed.

[1] be82787a00
2015-06-26 12:19:51 -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
Erik Arvidsson 96e5b67cd5 Fix issue with math_precision.js
It was missing vars which was causing issues with our test harness
since we run all the files in strict mode.
2015-06-25 16:43:10 -04:00
Mike Pennisi cb617493d7 Update browser runner to honor `onlyStrict` flag
Unlike the console runner, the browser runner does not modify the
strictness of tests prior to running them. Regardless of a given test's
metadata, it runs every test exactly once, and it never enables strict
mode. This means that tests intended to function in strict mode must
declare the "use strict"; directive prologue in addition to the
`onlyStrict` flag.

For any test that specifies the `onlyStrict` metadata flag, transform
the source code by injecting a "use strict" directive prologue prior to
running the test.
2015-06-18 17:38:33 -04:00
Mike Pennisi 73aa06275a Update browser runner to inject `assert.js`
Since the Python runner was updated to include `assert.js` in all tests
unconditionally, a number of tests have been written that implicitly
rely on its presence. The browser runner does not currently provide this
file's contents to these tests, so they fail unconditionally.

Update the browser runner to inject that file's contents into every test
context.

Note: the existing approach to file retrieval (namely loading via
synchronous XHR requests) is inefficient and deprecated in some
browsers. It is honored here for the sake of consistency and to minimize
the changeset necessary to fix the browser runner.
2015-06-18 13:53:09 -04:00
Mike Pennisi fe11a1ea1a Remove $PRINT helper function
The `$PRINT` helper function has no effect on test behavior. The
following tests use it to report assertion outcomes (and as a result
will fail silently):

- test/language/function-code/S10.2.1_A4_T2.js
- test/language/function-code/S10.2.1_A5.1_T1.js
- test/language/function-code/S10.2.1_A5.1_T2.js
- test/language/function-code/S10.2.1_A5.2_T1.js

Remove the function definition and all references within tests. Update
tests that use it as an error reporting mechanism to instead use an
appropriate `assert` helper function.
2015-06-16 13:43:23 -04:00
Mike Pennisi 92890e6723 Remove `$FAIL` function
This function is equivalent to `$ERROR` (which is automatically included
in test environments). Remove the harness file that defines the
function, remove references to the file from test `includes` lists, and
update scripts to instead invoke the `$ERROR` function.
2015-06-09 19:44:25 -04:00
André Bargull 56036e4064 Enable strict mode for more built-in tests
- Remove no longer needed noStrict flags.
- Change tests to use propertyHelper.js for strict mode compatibility.
- Add tests for return value of `delete` operator, e.g. `delete Array.prototype === false`.
- Add non-writable tests for global NaN property.
- Split some tests to run in strict mode.
- Change tests with global `var length` declaration to use a different variable name for browser environments.
- Merge duplicated tests symbol-data-property-configurable-non-strict and symbol-data-property-configurable-strict.
- Merge duplicated tests symbol-data-property-writable-non-strict and symbol-data-property-writable-strict.
- (And a small change in propertyHelper to reduce code duplication in function call.)
2015-05-18 18:01:00 +02:00
Mike Pennisi 67e9e070ef Correct error messages
The `testBuiltInObject` function verifies the presence of the specified
properties for *all* object types (not just function objects). Update
the error messages to reflect this.
2015-04-21 17:58:10 -04:00
Mike Pennisi c27938a123 Fix bug in `isWritable` utility function
Only attempt to re-set the property value in cases where it was
successfully modified as part of the function's execution. This avoids
errors when the underlying value is not writable. Rename the internal
result-tracking variable to make this more clear.
2015-04-21 15:00:26 -04:00
Mike Pennisi c91267235c Extend assertion error messages
When invoked without a custom assertion message, `assert.sameValue` and
`assert.notSameValue` automatically create a message that describes the
actual and expected values.

Extend both assertion methods to also include this information in cases
where a custom message has been specified.
2015-04-21 13:25:02 -04:00
Brian Terlson fd6f206d69 Merge pull request #194 from arv/function-length-is-configurable
Function length property is configurable
2015-04-08 15:58:30 -07:00
Rick Waldron d797bb979e Import tests from Google V8 (Array.prototype.{fill, find, findIndex}, Array.{from, of})
These tests are derived from the following files within the Google V8 project:

    	test/mjsunit/harmony/array-fill.js
    	test/mjsunit/harmony/array-find.js
    	test/mjsunit/harmony/array-findindex.js
    	test/mjsunit/harmony/array-from.js
    	test/mjsunit/harmony/array-of.js
2015-04-07 09:53:17 -04:00
Erik Arvidsson ad8af4be3a Function length property is configurable
In ES6 the function length property was changed to become
configurable.
2015-03-11 10:42:14 -04:00