Commit Graph

1284 Commits

Author SHA1 Message Date
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 cdc62ce0fa Re-generate tests 2016-10-19 15:24:20 -04:00
Mike Pennisi 0c29e6de86 Reformat miscellaneous negative tests
The expected errors in these tests cannot be asserted with the
`assert.throws` helper function for various reasons. Re-format their
meta-data according to the latest design in order to more precisely
describe test expectations.
2016-10-19 15:24:19 -04:00
Mike Pennisi 203b234fc0 Reformat negative SyntaxError tests (runtime)
These tests specifically concern error produced from the global scope,
precluding the use of the `assert.throws` helper function.
2016-10-19 15:24:18 -04:00
Mike Pennisi d5a3a962b2 Reformat negative ReferenceError tests 2016-10-19 15:24:18 -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
Joseph Pecoraro fb61ab44eb Fix incorrect generator syntax (#761) (#762) 2016-10-14 15:58:46 -07:00
Leo Balter febb11b249 Revert "islamicc should be canonicalized to islamic-civil (#747)" (#774)
This reverts commit da4f4385fd.
2016-10-14 11:05:41 -07:00
jugglinmike b9d6fec9ac Correct name of fixture file (#775)
The file previously named `values-binding-types_.js` is not intended to
be interpreted as a test. Therefor (in accordance with the project's
`INTERPETING.md` file), its name should include `_FIXTURE` as a suffix.
2016-10-14 11:04:47 -07:00
Leo Balter 8c67edab05 Fix invalid yaml on tests for global (#772) 2016-10-07 10:34:11 -07:00
Henrique Ferreiro 0651a7fad1 setPrototypeOf returns 'true' if called with the target's prototype (#768) 2016-10-05 13:25:35 -04:00
Tim Disney 9d8d8b6920 Add tests to handle revised template literals (#764) 2016-10-03 13:59:53 -07:00
Jakob Gruber 81f66a5a3a Tests for new lastIndex semantics (#760)
* Tests for new lastIndex semantics

Add and update tests for the lastIndex semantic change introduced in
https://github.com/tc39/ecma262/pull/627.

* Address comments
2016-09-29 10:41:37 -07:00
Jordan Harband be16caa4c8 Add `global` tests. (#765)
Closes #605, relates to #567 / https://github.com/tc39/proposal-global/issues/12 / 9c45e2ac68
2016-09-28 10:53:50 -07:00
jungshik da4f4385fd islamicc should be canonicalized to islamic-civil (#747)
Moves ismalicc test out of main.js and creates a new
test, preferred-subtag.js (per RFC 5646 section 4.5 and
http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
)

Fix #743
2016-09-12 12:54:55 -07:00
Viktor 29c2384449 Update return-values.js (Number#toExponential bug in Firefox) (#751)
Update test cases for Number#toExponential

Includes test cases addressing a known bug on Firefox 48.

Ref https://bugzilla.mozilla.org/show_bug.cgi?id=944846
2016-08-29 17:33:55 -04:00
Anthony Van de Gejuchte 11d7dcc997 Remove duplicate description keys 2016-08-27 18:55:27 -04:00
jugglinmike 4ffee35d89 Add tests for surrogate pairs with RegExp atoms (#722) 2016-08-25 13:29:51 -07:00
Tom Care b2b4254266 Merge pull request #727 from bocoup/audit2016-section-20-date
Improve coverage for section 20
2016-08-25 10:30:43 -07:00
jungshik fb45ed9772 Test that getCanonicalLocales() returns a mutable object. (#746)
Will fix #745

Besides, add additional checks to make sure that getCanonicalLocales()
returns an array.
2016-08-22 14:25:00 -07:00
Zibi Braniecki cac55f2999 NumberFormat.prototype.formatToParts tests, part 1 (#744) 2016-08-15 15:23:34 -07:00
Michael Ficarra 894bbcc747 add PropertyDefinitionList evaluation order test (#739)
This test is being added because the committee is considering changing
this evaluation order (as discussed at the May 2016 Munich meeting). The
consequences of this spec change will be more clear as a test change
than a simple test addition.
2016-08-12 12:01:43 -04:00
jugglinmike c5cbf4122d Improve coverage for section 9 (#726)
* Assert creation of 'arguments' object

Ensure that the 'arguments' object is created in cases where it is not
required by the body but is required by the parameters.

* Add tests for cases that disable "arguments" map

* Add tests for NewTarget override of bound function

* Add test for properties of exotic String objects
2016-08-05 10:07:02 -07:00
Tom Care 8a6d7a49ee Merge pull request #711 from bocoup/audit2016-section-21-regexp
Improve coverage for section 21: RegExp
2016-08-04 16:22:18 -07:00
Yusuke Suzuki dfd1fb3a97 Fix incorrect value retrieving in module-code test (#741)
Fix language/module-code/namespace/internals/get-own-property-str-found-init.js.
2016-08-04 11:19:36 -04:00
Kevin Gibbons d6580e8b66 Add tests for for-in initializers (#735)
These were re-introduced in sloppy mode per
https://github.com/tc39/ecma262/pull/614
2016-08-02 15:47:39 -04:00
Jordan Harband 55cf59c80d `Object.getOwnPropertyDescriptors`: add test to ensure undefined descriptors are not added. (#662)
Per https://github.com/tc39/ecma262/pull/593
2016-08-01 13:54:53 -04:00
Yusuke Suzuki e2fb909a1d Fix importing filename in module-code/instn-star-err-not-found.js test
Fix the incorrect module filename.
2016-07-30 15:08:26 -04:00
Brian Terlson dbf251586e Add tests for async functions
Closes #479
2016-07-28 15:11:28 -07:00
Jeff Morrison b785fdf942 Tests for trailing commas in function arg lists (#733)
Adds tests for the proposal as described here:
http://jeffmo.github.io/es-trailing-function-commas/
2016-07-28 12:32:03 -07:00
Zibi Braniecki 1bf44eb349 Add DateTimeFormat.prototype.formatToParts tests (#734) 2016-07-28 10:22:09 -07:00
Leo Balter 3275f17cd4 Add tests for Number#toExponential (#664)
* Add tests for Number#toExponential
2016-07-21 10:57:05 -07:00
Tom Care 9ec41dfabd Merge pull request #719 from bocoup/audit2016-section-15
Improve coverage for section 15: Scripts and Modules
2016-07-20 14:28:29 -07:00
jugglinmike b9e21138cc Add tests for script interactions (#689)
ECMA262 allows for an arbitrary number of "ScriptJob"s to run in a given realm.
Although there is no standard mechanism for enqueuing these jobs, many
implementations offer this functionality through custom APIs. In those hosts,
the semantics describing script interactions are directly observable.
In order to guarantee conformance to the specification in advance of a
standardized API, Test262 now requires that hosts provide a $.evalScript
function whose behavior is defined in the project's "INTERPRETING.md" file.
Use this host-provided API to ensure that implementations correctly observe the
specification text that dictates script interactions.
(In writing these tests, I noticed some gaps in coverage that are observable
from a single script execution. This patch includes a dedicated commit for
these tests that do not require $.evalScript.)

* Improve coverage of GlobalDeclarationInstantiation

* Add tests for script interactions

Use the host-provied `$.evalScript` method to assert conformance to the
specification text that defines script interactions.

* fixup! Improve coverage of GlobalDeclarationInstantiation
2016-07-19 18:02:05 -07:00
Tom Care e3ae1c88ff Merge pull request #699 from bocoup/685-range-check
Fix range check tests for DataView#set methods
2016-07-19 14:55:14 -07:00
Leo Balter e8e0fb9d34 Update tests for Proxy.[[SetPrototypeOf]] (#716)
* Update tests for Proxy.[[SetPrototypeOf]]

Expand coverage for proxies' [[SetPrototypeOf]] and update tests to
verify that target's [[IsExtensible]] is not called anymore if trap
returns a falsy value.

Ref tc39/ecma262#331
2016-07-19 14:51:02 -07:00
jugglinmike 2c5138a4c7 Add tests for abrupt completions during JSON.parse (#721)
* Add tests for abrupt completions during JSON.parse

Due to the use of the IsArray abstract operation, observing many of the
targeted semantics requires the use of a Proxy exotic object. Mark the
tests that require this unrelated ES2015 feature using a dedicated
"features" flag.
2016-07-19 14:33:27 -07:00
Tom Care 163fae3e68 Merge pull request #715 from bocoup/audit2016-section-13
Improve coverage for section 13, "Statements and Declarations"
2016-07-12 13:51:15 -07:00
jugglinmike a41b71115b Annex b skip fib (#704)
* Re-generate tests

The test generation tool has been modified in the time since these tests
were first generated and committed to the project. Re-generate the tests
using the latest version of the tool.

* Add test cases for Annex B hoisting disqualifiers

The "variable-like" function hoisting semantics defined in Annex B
extension B.3.3 is only applied if "[...] replacing the
FunctionDeclaration f with a VariableStatement that has F as a
BindingIdentifier would not produce any Early Errors [...]". Test262
previously included tests for this condition when the disqualifying
early error originated from the ScriptBody and FunctionBody productions.

Add test cases to assert the behavior when it is disqualified by all
other relevant early errors: Block statements, `for` statements,
`for-of` statements, `for-in` statements, and Switch statements.

* Generate tests

* fixup! Add test cases for Annex B hoisting disqualifiers

* fixup! Add test cases for Annex B hoisting disqualifiers

Correct test case "info" meta-data.

* fixup! Add test cases for Annex B hoisting disqualifiers

Improve test bodies

* fixup! Generate tests
2016-07-11 16:37:42 -07:00
jugglinmike 35206ee85b Add test for subclassing bound functions (#720)
The semantics under test have been incorrectly implemented by the
SpiderMonkey engine.
2016-07-11 13:46:03 -07:00
Mike Pennisi acebbcaeb2 Add tests for Date.prototype methods 2016-07-09 13:09:15 -04:00
Mike Pennisi 8918e860cc Add tests for Date.UTC 2016-07-09 12:15:17 -04:00
Mike Pennisi 8791771268 Add test for subclassing Date 2016-07-09 12:15:16 -04:00
Mike Pennisi 7ac2aa06ca Add test for `name` property of Date constructor 2016-07-09 12:15:16 -04:00
Mike Pennisi 577a9cac9e Add tests for use of ToPrimitive in Date ctor 2016-07-09 12:15:15 -04:00
jugglinmike da0a8e33f0 Improve coverage for section 14: Functions and Classes (#717)
* Add tests for early errors in functions

* Improve tests for class accessors

Use the `propertyHelper.js` utility in order to functionally test the
property descriptors of class methods.

* Remove redundant tests

The semantics of an IdentifierReference as a PropertyDefinition within
an object initializer are exhaustively tested by the files in this
directory whose name match the pattern `prop-def-id-*.js`.

Delete the redundant tests in favor of the more descriptively-named and
more exhaustive alternatives.

* Rename tests

* Update test names to be more descriptive

* Add tests for property descriptors of accessors

* Add tests for runtime error during method dfn

* Add test for observable iteration
2016-07-08 18:43:32 -07:00
jugglinmike 2bfaa0d895 Improve coverage for class "name" inference (#718)
* Extend tests for class "name" inference

Ensure that when a class defines a static "name" method, that method
definition prevents the "name" inference behavior.

* Re-generate tests
2016-07-08 18:37:04 -07:00
jugglinmike 8d78eddcc6 Add test for early error in RegExp literals (#723) 2016-07-08 18:01:35 -07:00
Leonardo Balter 7b1eddf6b0 Update and expand tests for isNaN 2016-07-07 15:55:28 -04:00
Leonardo Balter 81f22800fa Update and expand tests for isFinite 2016-07-07 15:55:27 -04:00