Commit Graph

22 Commits

Author SHA1 Message Date
jugglinmike 8953024f1a Remove duplicate tests (#2377)
* Remove duplicate test

The behavior under test is verified by another file in Test262:

test/language/expressions/compound-assignment/S11.13.2_A2.1_T3.3.js

That version is preferable because it does not depend on `eval` and
because it supports both strict and non-strict mode.

* Remove overly-permissive test

By asserting only the presence of an "own" property, this test can be
satisfied from both strict mode code and non-strict mode code.

The following test verifies the presence of the "own" property and the
associated descriptor's values in strict mode:

test/language/arguments-object/10.6-13-c-3-s.js

That subsumes the semantics verified by this test, making it
superfluous. Remove the test.

* Remove overly-permissive test

By asserting only the absence of a syntax error, this test can be
satisfied from both strict mode code and non-strict mode code.

The following test verifies the runtime behavior of accessing the
property in strict mode code:

test/language/arguments-object/10.6-13-c-1-s.js

That subsumes the semantics verified by this test, making it
superfluous. Remove the test.

* Remove duplicate test

The behavior under test is verified by another file in Test262:

test/built-ins/Math/prop-desc.js

That version is preferable because it follows the test suite's
convention for testing property descriptors and because it supports both
strict and non-strict mode.

* Remove duplicate test

The behavior under test is verified by two separate files:

test/language/statements/function/line-terminator-non-strict.js
test/language/statements/function/line-terminator-strict.js

These files differ only in their usage of the `noStrict`/`onlyStrict`
metadata. Because tests are intended to be interpreted in both modes by
default, these can be expressed with a single file that does not limit
the permissible modes.
2019-09-27 16:31:44 -04:00
Mike Pennisi 9cd62ffbd7 Improve coverage: ctor props of the global object
Prior to this commit, the descriptors of the constructor properties of
the global object were verified inconsistently, many independent
assertions occured in the same file, and that file test was poorly
located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi 1f079a3525 Improve coverage: func props of the global object
Prior to this commit, the descriptors of the function properties of the
global object were verified inconsistently, many independent assertions
occured in the same file, and that file test was poorly located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi f8957be8a7 Improve coverage: value props of the global object
Prior to this commit, the enumerability of the value properties of the
global object were only verified in strict mode, the assertions occured
in the same file, and that file test was poorly located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi f5d60d4192 Improve coverage
The modified tests are equally valid in strict mode and outside of
strict mode. Remove the flag which limits their use to only one of these
two contexts. Rename tests using the legacy ES5-based naming scheme to
remove the pattern which designates strict mode.
2019-09-27 15:39:10 -04:00
Jordan Harband 765de9136d
`global`: update property name 2018-07-25 17:11:53 -07:00
Leo Balter e89e9a8a28
Add global feature tag (#1600) 2018-06-18 18:00:19 -04:00
Rick Waldron 6e7ba5060c built-ins/global/*: make all indentation consistent (depth & character) (#1438) 2018-02-15 15:25:21 -05:00
André Bargull f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722.
2018-02-09 12:09:47 -05:00
Rick Waldron a01de4a722 js-beautify: make all indentation consistent (depth & character) (#1409) 2018-02-09 11:35:37 -05:00
André Bargull f717982c94 Remove unused includes 2018-01-25 13:59:37 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
André Bargull 204266794c Fix various test issues (#840)
test/annexB/built-ins/Date/prototype/setYear/time-clip.js
test/built-ins/Date/prototype/setFullYear/new-value-time-clip.js
test/built-ins/Date/prototype/setMonth/new-value-time-clip.js
- Don't try to test time-clip at the end points, because this is near
impossible to get right (needs to consider time zone offset, dst, local
mean time because of Africa/Monrovia, etc.).

test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js
test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js
- Wasn't update to expect RangeError

test/built-ins/Function/internals/Construct/derived-this-uninitialized-realm.js
- Change ClassDeclaration -> ClassExpression to get completion value

test/built-ins/Function/prototype/toString/AsyncFunction.js
- Add missing \n in expected string
- Also fixed in gh-847

test/built-ins/global/global-object.js
- Add 'var' to make test pass in strict-mode

test/language/block-scope/syntax/redeclaration-in-block/attempt-to-redeclare-function-declaration-with-function-declaration.js
- This is allowed in sloppy mode when Annex B is implemented

test/language/expressions/async-generators/expression-yield-as-statement.js
- Fix calls to then()

test/language/module-code/namespace/internals/own-property-keys-binding-types.js
test/language/module-code/namespace/internals/own-property-keys-sort.js
- Tests weren't updated after removal of @@iterator from module
namespace objects

test/language/module-code/namespace/internals/set-prototype-of-null.js
- Fix syntax error

test/language/statements/async-function/early-errors-no-async-generator.js
- No longer valid now that async iteration proposal is at stage 3
2017-02-07 11:10:56 -05:00
Leo Balter 8c67edab05 Fix invalid yaml on tests for global (#772) 2016-10-07 10:34:11 -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
André Bargull bd603294cb Replace runTestCase with assert, try-finally 2015-08-13 17:43:11 +02:00
André Bargull 589b638ab5 Replace runTestCase with assert.throws [test/built-ins] 2015-08-11 17:44:37 +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
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
André Bargull 3987990563 Additional tests with incorrect for-in context
- Add missing ".prototype" lookup in Array.prototype tests (Follow-up of #280)
- Add noStrict flag in global/S10.2.3_A2.2_*.js (implicit this-binding is part of the test)
- Provide correct this-binding in function/13.2-*.js
- Add missing assert.throws in "set-iterator-close-after-add-failure.js"
2015-05-26 17:52:52 +02:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00