Commit Graph

4409 Commits

Author SHA1 Message Date
Leo Balter ec41c1a417 Add tests for Nullish Coalesce Expression 2019-10-09 21:52:52 -04:00
Leo Balter 6b66b82d88 Cleanup compareArray and deepEqual assertions, remove assert._formatValue
Fixes #2372
2019-10-09 17:57:10 -04:00
Leo Balter 4182972a49
Merge pull request #2396 from leobalter/2381/yaml
Yaml consistency
2019-10-09 13:29:16 -04:00
Jordan Harband 59d1af9d2a [matchAll] pass a global regex (#2399)
- also, expect the right kind of error in `flags-undefined-throws.js`

Fixes #2398
2019-10-09 10:32:39 -04:00
Leo Balter d49777de27 Whitespace cleanups. CRLF => LF 2019-10-08 20:44:09 -04:00
Alexey Shvayka bb6ce7e435 Add test for Proxy "has" trap on prototype (#2382)
* Use allowProxyTraps.js in [[Set]] tests

* Add [[HasProperty]] test
2019-10-08 14:58:27 -04:00
Alexey Shvayka 1aac32e2f8 Improve Proxy/ownKeys invariants coverage (#2384)
* Add non-configurable invariant test

* Add non-extensible invariant test
2019-10-08 14:54:46 -04:00
Frank Yung-Fong Tang 79591ae6c8 Add test for #349 and #351 PR (#2379)
Test DateTimeFormat change pattern based on calendar and output relatedYear and yearName
based on the assumption that "en-u-ca-chinese" will output 'relatedYear' and 'yearName'.
https://github.com/tc39/ecma402/pull/349
https://github.com/tc39/ecma402/pull/351
@rwaldron @leobalter @Ms2ger @littledan
2019-10-08 14:54:02 -04:00
Leo Balter 2b48ec7a00 More yaml and whitespace fixes
Ref #2383
2019-10-08 14:50:57 -04:00
Leo Balter 917e6f7f99 Yaml consistency
Ref #2381
2019-10-08 14:48:59 -04:00
Frank Yung-Fong Tang 79a01f5122 Add tests for 'numberingSystem' and 'calendar' options (#2383)
* Add tests for 'numberingSystem' option

* add constructor-numberingSystem-order.js

* correct esid

* initial actual

* add let

* add constructor-calendar-numberingSystem-order.js
2019-10-08 14:48:46 -04:00
Frank Yung-Fong Tang b073c48b49 Add test to ensure Intl.DateTimeFormat choose pattern by calendar (#2381)
* Add test for different pattern based on calendar

* Add test for formatRangeToParts

* remove  debug print

* fix typo

* fix typo

* address review feedback

* address review feedback

* change the map and use string template

* rewrite maps and use string template
2019-10-08 14:44:41 -04:00
Frank Yung-Fong Tang 8f6369d1c4 Add more tests for ListFormat (#2387)
* add tests for ListFormat

address https://github.com/tc39/test262/issues/2386

* add test for formatToParts(undefined)

* test GetIterator throw error

* test formatToParts while GetIterator throws error

* test formatToParts while step_iterator throw

* test format while iteratorStep throw

* fix object name

* test format while IteratorValue throws

* test formatToParts while iteratorValue throws

* test formatToParts while iteratorClose call return

* check format with iteratorClose calls return
2019-10-08 14:42:42 -04:00
Frank Yung-Fong Tang 2715f312db Add tests for ListFormat StringListFromIterable ( iterable ) (#2380)
* Add tests for StringListFromIterable

* add case throw TypeError

* add test for formatToParts

* add test for formatToParts
2019-10-08 14:42:26 -04:00
Alexey Shvayka 71a70fc117 Use isConstructor in "executor-function-nonconstructor.js" (#2393) 2019-10-08 14:41:29 -04:00
Alexey Shvayka 34cbf0aed2 Add "proto-from-ctor-realm" tests for Intl proposals (#2346)
* Add Intl.Segmenter test

* Add Intl.RelativeTimeFormat test

* Add Intl.Locale test

* Add Intl.ListFormat test
2019-10-08 14:39:52 -04:00
Joyee Cheung 13882715c3 Undefined private name access in computed property keys should throw TypeError (#2390)
Refs: https://github.com/tc39/proposal-class-fields/pull/269
2019-10-08 14:39:15 -04:00
Mathias Bynens a898fe9826 Add missing `regexp-match-indices` feature tags (#2395) 2019-10-08 14:38:39 -04:00
Leo Balter 8688c4ab79
Fix typo: iterator => iterator (#2394)
Fix #2392
2019-10-07 12:43:23 -04:00
Leo Balter 0a22ea3d29
Merge pull request #2388 from nicolo-ribaudo/patch-9
Add missing "flags: [module]" to top level await tests
2019-10-03 14:48:34 -04:00
Jordan Harband f3e950e8ed tests for String.prototype.matchAll changes (#2389)
Per https://github.com/tc39/ecma262/pull/1716
2019-10-03 14:47:00 -04:00
Nicolò Ribaudo 38709d0cca
Generate tests 2019-10-03 11:35:52 +02:00
Nicolò Ribaudo bc406c0cf7
Add missing "flags: [module]" to top level await tests 2019-10-03 11:35:48 +02:00
Leo Balter a1acc23cd8
Merge pull request #2367 from bocoup/unnecessary-includes-lint
lint: add rule to verify use of harness files
2019-09-27 16:47:40 -04:00
Leo Balter e2903e2648
Merge pull request #2366 from bocoup/unnecessary-includes
Remove unnecessary "includes" directives
2019-09-27 16:46:22 -04:00
jugglinmike 87e875f6c9 Correct errors in metadata (#2378)
* Correct typo

* Correct esid
2019-09-27 16:32:52 -04:00
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
Leo Balter 83d9f750c9
Merge pull request #2376 from bocoup/ud-coverage
Improve coverage
2019-09-27 16:30:13 -04:00
jugglinmike 479ea0ec0b Avoid false positive (#2375)
Prior to this patch, the modified test would pass if no exception was
produced. Use the `assert.throws` utility function to concisely express
the expectation more completely.
2019-09-27 16:25:07 -04:00
jugglinmike 83483b7310 Consolidate harness tests (#2374) 2019-09-27 16:24:02 -04:00
jugglinmike 5757d60e17 Correct syntax in generated tests (#2373)
Prior to the application of this patch, the modified test template
included an unintentional syntax error. This caused all generated tests
to spuriously satisfy the expectation for an error.

Correct the syntax in the test template and regenerate the tests,
ensuring that when engines report a syntax error, they are demonstrating
the behavior which the tests were designed to verify.
2019-09-27 16:22:56 -04:00
Mike Pennisi d4a91a163b Improve coverage: function declarations
Previously, these tests were limited to strict mode. The syntactic
restriction under test also applied outside of strict mode even when
Annex B is observed, so configure the tests to also run outside of
strict mode.
2019-09-27 15:39:10 -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
Leo Balter 8d4c5f502f Generate tests 2019-09-27 13:23:44 -04:00
Leo Balter 2e82d31eac Add tests for evaluation and export declarations in TLA 2019-09-27 13:23:44 -04:00
Leo Balter 69bf8fb0f8 Update tests for top-level await 2019-09-27 13:23:44 -04:00
Leo Balter 32bb36f5e4 Tests for TLA module evaluation 2019-09-26 14:28:56 -04:00
Frank Yung-Fong Tang 0213936e95 remove test for abandon ecma402/pull/345 (#2368)
https://github.com/tc39/ecma402/pull/345
2019-09-26 14:23:24 -04:00
Mike Pennisi a9111d7144 lint: add rule to verify use of harness files
Verify that every test file which references a harness file using the
"includes" directive also contains at least one reference to a value
defined in the harness file.

To support this check, extend each harness file with a list of values
which it defines.
2019-09-25 14:00:50 -04:00
Mike Pennisi bb5a6622d4 lint: Compute ergonomic name for tests
The command-line interface to Python's "unittest" module allows users to
run tests by name, e.g.

    $ test.py TestLinter.test_foo

If the tests include a period, they cannot be referenced in this way.
Rename the tests to omit the filename extension so that they may be
referenced from the command-line in this way.
2019-09-25 14:00:50 -04:00
Mike Pennisi f38748efc1 lint: Increase isolation between tests and project
Prior to this commit, the tests for the linter partially depended on
project files. This coupling risks churn in the tests: if the needs of
the project change (e.g. a harness file is modified), then the linter
tests would need to be updated. It also made the tests more difficult to
understand because the input was both larger and more complicated than
necessary to exercise the relevant functionality.

Execute the tests in the context of the fixture directory and introduce
minimal support files that serve the same purpose as the corresponding
project files.
2019-09-25 14:00:50 -04:00
Mike Pennisi 1e4e524251 Update tests to use APIs defined by included files
The `$DETACHBUFFER` function is the preferred mechanism for detaching
array buffers.

Likewise, `verifyNotWritable` is the preferred mechanism for asserting
lack of writability.
2019-09-25 13:59:24 -04:00
Mike Pennisi f26c2a11bd Remove unnecessary "includes" directives
The values defined by the referenced files are not used by these tests.
This makes their inclusion superfluous, which needlessly increases the
time to execute the tests and may confuse some readers.
2019-09-25 13:59:24 -04:00
jugglinmike ce2dfd49d1 Correct bug in property helper (#2364)
Allow the property helper to be used to verify the configurability of
the global "Object" property.
2019-09-24 16:05:30 -04:00
Leo Balter 38ffce541d ASI after do-while in the same line 2019-09-24 14:16:40 -04:00
Nicolò Ribaudo 5de1bb4cd5 Add missing used features to private fields tests (#2361) 2019-09-24 13:51:47 -04:00
Nicolò Ribaudo 7697d3a1d5 Test specific error in super-private-access-invalid.case (#2355)
Without declaring #x in the class body, the thrown error could have been
about the undeclared private name rather than about the SuperProperty
2019-09-24 13:51:10 -04:00