Commit Graph

269 Commits

Author SHA1 Message Date
Csaba Osztrogonác bd1acb51a4 tools: enforce restriction on YAML includes key
Includes key should use flow notation to be able parsed easier
as suggested in https://github.com/tc39/test262/issues/1997

Added this check to the linting script and updated tests accordingly.
2022-01-05 17:27:58 -05:00
Mike Pennisi 08a9fc2b97 Fix: correct Resizable ArrayBuffer/Array tests
Prior to this patch, the tests for certain Array prototype methods
incorrectly expected all elements to be "visited" even when a given
property was not present according to HasProperty.

Update the tests to reflect the fact that under such conditions, the
removed element is not visited.
2021-12-18 11:50:47 -05:00
Mike Pennisi 6d5975defc Remove duplicated constructor tests
A number of tests were found to be duplicative based on an analysis of
file contents (included below). Eliminate the duplication by removing
the version of each test with less precise metadata. In cases where this
removal could technically be considered a reduction in coverage,
preserve the verification of additional semantics in the remaining test.

    $ git grep -El 'new\s+\w+.prototype' | sed 's/[^\/]\+$//g' | sort | uniq -c | grep -vE '^\s+1 ' | awk '{print $2}' | xargs grep -Elr 'new\s+\w+.prototype'
    test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js
    test/built-ins/Array/prototype/join/not-a-constructor.js
    test/built-ins/Array/prototype/pop/not-a-constructor.js
    test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js
    test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js
    test/built-ins/Array/prototype/push/not-a-constructor.js
    test/built-ins/Array/prototype/shift/not-a-constructor.js
    test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js
    test/built-ins/Array/prototype/slice/not-a-constructor.js
    test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js
    test/built-ins/Array/prototype/sort/not-a-constructor.js
    test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js
    test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js
    test/built-ins/Array/prototype/splice/not-a-constructor.js
    test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js
    test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js
    test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js
    test/built-ins/Array/prototype/toString/not-a-constructor.js
    test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js
    test/built-ins/Array/prototype/unshift/not-a-constructor.js
    test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js
    test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js
    test/built-ins/Function/prototype/apply/not-a-constructor.js
    test/built-ins/Function/prototype/call/not-a-constructor.js
    test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js
    test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js
    test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js
    test/built-ins/Function/prototype/toString/not-a-constructor.js
    test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js
    test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js
    test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js
    test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js
    test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js
    test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js
    test/built-ins/Object/prototype/toString/not-a-constructor.js
    test/built-ins/Object/prototype/toString/not-ctor.js
    test/built-ins/Object/prototype/valueOf/not-a-constructor.js
    test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js
2021-12-14 13:38:51 -05:00
Nicolò Ribaudo 2b2d35de69
Delete duplicate "`Array#reverse` is not a constructor" test (#3342)
It's already tested by test/built-ins/Array/prototype/reverse/not-a-constructor.js
2021-12-10 14:09:36 -05:00
rwaldron a5d8e8e997 test: Add more Array.from tests for array-like. Closes gh-3336 2021-12-07 09:40:23 -05:00
Mike Pennisi eb153de85b Add tests: resizing ArrayBuffer during iteration
The Resizable ArrayBuffer proposal allows implementations to reject any
resize operation, so the tests must accommodate that possibility.

Mitigate the complexity this entails by minimizing branches and by
deferring assertions to locations with shallow call stacks.
2021-11-09 13:27:58 -05:00
Rick Waldron fc975b171d
Transform compareArray -> assert.compareArray: test/built-ins/Array/**/*.js (#3238) 2021-10-08 16:16:32 -04:00
Mike Pennisi a6834093aa Improve coverage by invoking functions as intended
Some tests which include function declarations designed to verify
behavior do not reference those functions. Insert the references
necessary for those functions to serve their intended purpose.
2021-10-05 16:22:56 -04:00
Mike Pennisi d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be, reversing
changes made to 50dd431dff. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00
rwaldron 4847d9db5a chore: update test/**/*.js to use assert.compareArray wherever applicable 2021-09-24 12:58:15 -04:00
Mike Pennisi 8fad17a506 Focus tests for `copyWithin` methods
Prior to this commit, a test for %TypedArray%.prototype.copyWithin
provided a TypedArray instance as the first argument. That argument that
is interpreted as a number, so in relying on the conversion, the test
verified behavior beyond what it purported to test.

Simplify the test by using the desired number value directly, and extend
the tests for type coercion to cover object values.
2021-09-23 15:20:34 -04:00
Mickey Rose 836111dc3c
remove redundant throw from assert.throws() test functions (#3167) 2021-08-26 07:55:52 -07:00
rwaldron 21e627b35d Transform legacy format to harness assertions 2021-08-11 10:42:40 -04:00
rwaldron 08cf542e1b Remove "//CHECK#\d" 2021-08-11 10:20:11 -04:00
Rick Waldron 452c0e5c61
Automated assertion message update: Array * (#3140)
* Automated assertion message update: Array.from

* Automated assertion message update: Array.isArray

* Automated assertion message update: Array length property

* Automated assertion message update: Array.of

* Automated assertion message update: Array

* Automated assertion message update: Array.prototype.at

* Automated assertion message update: Array.prototype.concat

* Automated assertion message update: compareArray -> assert.compareArray
2021-08-10 14:51:54 -07:00
Shu-yu Guo 5a6577bcc9
Add missing array-find-from-last feature to unscopables test (#3130) 2021-08-03 13:17:38 -07:00
Wenlu Wang 915f7e79be Fix incorrect case 2021-07-28 13:53:14 -04:00
Wenlu Wang 74727cd4ed Fix CR issues 2021-07-28 13:53:14 -04:00
Wenlu Wang 5da8030779 Fix format 2021-07-28 13:53:13 -04:00
rwaldron 4b54d54113 Fix copyrights and features metadata 2021-07-28 13:53:12 -04:00
Wenlu Wang 6c5e421806 Add unscopable tests 2021-07-28 13:51:37 -04:00
Wenlu Wang a4aeea09ae Avoid useless spec statement 2021-07-28 13:51:37 -04:00
Wenlu Wang 3bb6d6480e Add findLastIndex tests 2021-07-28 13:51:37 -04:00
Wenlu Wang 275e7f1595 Add tests for proposal array find from last 2021-07-28 13:51:37 -04:00
Rick Waldron 99ab8cce08
chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Array (#3071) 2021-07-21 11:53:23 -07:00
Alexey Shvayka 6e61dd7754
Test Array's toString() with non-callable "join" (#2973)
* Test Array's toString() with non-callable "join"

* Remove Array.prototype.join modifications
2021-04-15 20:51:08 -04:00
Alexey Shvayka c00087e129 Test Array.prototype.sort called with a primitive 2021-03-02 16:33:02 -05:00
Mathias Bynens 79060efc7f Add tests for accessors setting their successor 2021-01-27 09:23:28 -05:00
Mathias Bynens e610e75985 Add tests for accessors setting precedessors 2021-01-27 09:23:28 -05:00
Mathias Bynens 80c18c0ea8 Add tests for accessors popping elements 2021-01-27 09:23:28 -05:00
Mathias Bynens 7733d900b2 Add tests for accessors increasing length 2021-01-27 09:23:28 -05:00
Mathias Bynens b7da7c75ce Rename tests 2021-01-27 09:23:28 -05:00
Mathias Bynens 82f634d7fc Add tests for more precise Array#sort
https://github.com/tc39/ecma262/pull/1585
2021-01-27 09:23:28 -05:00
Sébastien Ros 7376666039 Typo 2020-12-10 09:19:33 -05:00
Rick Waldron 3b425c6da3 Coverage: missing tests for Array.prototype.reverse method. Fixes gh-2902 2020-12-02 16:34:44 -05:00
Leo Balter 2e5ff2461b fixup! Fix missing renames for item->at 2020-11-18 15:18:14 -05:00
Leo Balter 65bd4432f9 Fix missing renames for item->at
Ref #2905
2020-11-18 15:18:14 -05:00
Ross Kirsling df1bce9c2e Rename item() to at(). 2020-11-18 13:31:11 -05:00
Rick Waldron d576baf73f Info: adds "sec-evaluatenew" step to info for all "not-a-constructor.js" tests. 2020-10-06 12:01:34 -04:00
Rick Waldron 8aacff591c Standardize built-in constructor testing 2020-10-06 12:01:34 -04:00
Rick Waldron c644ede430 Built-in function objects that are not identified as constructors must throw a TypeError exception when new'ed. Fixes gh-1739 2020-10-06 12:01:34 -04:00
Rick Waldron e3b12065b2 Coverage: Array.prototype.item, String.prototype.item, TypedArray.prototype.item. Closes gh-2809, gh-2810, gh-2811 2020-09-24 17:23:38 -04:00
Rick Waldron 07cc3c8bb1 Coverage: calling array methods with boolean as thisValue. Fixes gh-2803 2020-09-24 14:52:48 -04:00
Rick Waldron f94fc660cc Array#shift throws TypeError if this value's "length" property was defined with [[Writable]]: false. Fixes gh-2773 2020-09-15 16:35:11 -04:00
Alexey Shvayka afd849ad29 Test "length" [[Value]] overflow check order in ArraySetLength 2020-09-09 14:40:23 -04:00
Alexey Shvayka d993d87766 Test "length" [[Value]] coercion order in ArraySetLength 2020-09-09 14:40:23 -04:00
Alexey Shvayka 9857b124c0 Test Array.prototype methods called as top-level functions 2020-09-09 14:34:20 -04:00
Alexey Shvayka c64db438df Test [[Set]] failure near integer limit in Array.prototype.push 2020-09-02 15:30:33 -04:00
Leo Balter 2e127ec40e Rename usage of master to main
Ref #2699
2020-07-15 15:47:15 -04:00
Alexey Shvayka 20a1345bbe Add Array.prototype.lastIndexOf test 2020-06-24 15:14:04 -04:00