Commit Graph

293 Commits

Author SHA1 Message Date
Alexey Shvayka 06357bed6a Add Array#filter non-extensible test 2020-02-20 12:36:10 -05:00
Alexey Shvayka d842aa21af Add Array#filter non-configurable property test 2020-02-20 12:36:10 -05:00
Alexey Shvayka 10ead92024 Add Array#map non-extensible test 2020-02-20 12:36:10 -05:00
Alexey Shvayka 1f7a0be6f5 Add Array#map non-configurable property test 2020-02-20 12:36:10 -05:00
Alexey Shvayka ac1c1b23c6 Add Array.of non-writable property test 2020-02-20 12:36:10 -05:00
Alexey Shvayka 61aa9951f2 Add Array.from non-writable property tests 2020-02-20 12:36:10 -05:00
Alexey Shvayka 8d4fbb4ab9 Add Array.from with non-iterable test 2020-02-20 12:36:10 -05:00
Alexey Shvayka b478d5fa29 Make Array.from with iterable test more precise 2020-02-20 12:36:10 -05:00
Ross Kirsling 623e9d199a Add tests for Array methods throwing with string receiver. (#2463) 2020-01-08 14:00:30 -05:00
Natalie Silvanovich 0ddce199d5 Adding tests for Array.prototype.copyWithin (#2443)
* Adding tests for Array.prototype.copyWithin. This case caused a security bug in Moddable
2019-12-18 11:26:19 -05:00
Gus Caplan a53f43e1ce
add missing newlines in tests 2019-11-10 20:18:56 -08: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
Alexey Shvayka ff83fb2922 Improve "proto-from-ctor-realm" coverage for Array (#2340)
* Rename "Array/proto-from-ctor-realm.js" test

* Add single argument test

* Add two arguments test
2019-09-18 13:26:40 -03:00
Leo Balter ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Aleksey Shvayka 993601089b Add Array property descriptor test (#2164) 2019-05-15 12:33:52 -04:00
Michael Ficarra 7238135940 add flat/flatMap to Array unscopables 2019-01-30 10:02:35 -05:00
Leo Balter 258da539bc refactor coverage for flatMap 2018-12-20 13:08:21 -05:00
Mathias Bynens b2597d060d Add tests for Array.prototype.sort stability (#1977)
https://github.com/tc39/ecma262/pull/1340
2018-12-06 11:56:58 -05:00
André Bargull b62dae4fff Fix various bugs in test cases (#1988) 2018-12-05 15:48:28 -05:00
Rick Waldron 2e18327af2 Eliminate false positives: Array.prototype.flat, Array.prototype.flatMap 2018-11-30 09:27:07 -05:00
Leo Balter 1307fa8f44 some quick fixes for Array.prototype.{flat,flatMap} tests 2018-08-20 11:16:54 -04:00
rhuanjl 1bffb14efb Array.prototype.flat and Array.prototype.flatMap property access count 2018-08-20 06:31:04 +01:00
Rick Waldron a8f7012587 Array.prototype.flatten => Array.prototype.flat (#1569) 2018-05-22 15:47:50 -04:00
André Bargull b552dad5cb Various test cases for cross-browser compliance bugs 2018-05-03 09:27:27 -07:00
Rick Waldron afa24856b4 built-ins/Array/*: make all indentation consistent (depth & character) (#1415) 2018-02-15 17:40:02 -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 82c6148980 Add missing closing parenthesis and remove invalid async flag (#1402) 2018-02-01 14:04:51 -05:00
André Bargull 658f19005b assert.compareArray does not perform deep-equality comparison 2018-01-25 13:59:37 -05:00
Rick Waldron 4afc330363 Fix: various lint fixes 2018-01-10 17:29:48 -05:00
Michael Ficarra 041da54c02 add flatten/flatMap to features.txt and mark appropriate tests 2018-01-05 16:59:34 -05:00
Michael Ficarra d8233624aa add missing compareArray function 2018-01-05 16:59:34 -05:00
Michael Ficarra 6bd7b21a2b add myself to flatten/flatMap copyrights 2018-01-05 16:59:34 -05:00
Michael Ficarra 33b6c31331 use `onlyStrict` flag instead of `"use strict"` directive 2018-01-05 16:59:34 -05:00
Michael Ficarra 02ceb62400 flatMap/flatten test improvements 2018-01-05 16:59:34 -05:00
shilpi 1547e49c95 flatten and flatMap tests 2018-01-05 16:59:34 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Leo Balter 168cc4c638
Improve Array#sort tests for verifying non callable comparefn (#1352)
Fix #1345
2017-11-21 11:41:18 -05:00
Leo Balter 7cbbe51216 Add cross-realm feature 2017-09-22 15:29:10 -04:00
Leo Balter 5fc0a7c6a1 Add missing Symbol.species feature flags 2017-09-08 10:13:50 -04:00
Leo Balter 72537004b0 Add missing Symbol.isConcatSpreadable feature flags 2017-09-08 10:13:50 -04:00
Leo Balter 2bee5df77a Add missing Symbol.iterator feature flags 2017-09-08 10:13:50 -04:00
Leo Balter c41faf1aca Add missing Symbol features flags 2017-09-07 15:51:13 -04:00
deathbearbrown 7cc2e921c8 add esid to array/prototype/values tests 2017-07-12 17:06:49 -04:00
deathbearbrown b2737b2d82 add esid to array/prototype/unshift tests 2017-07-12 17:06:06 -04:00
deathbearbrown 2d13a07cc1 add esid to array/prototype/toString tests 2017-07-12 17:05:52 -04:00
deathbearbrown 20b8c9b896 add esid to array/prototype/splice tests 2017-07-12 17:05:44 -04:00
deathbearbrown e07385fff4 add esid to array/prototype/Symbol.unscopables tests 2017-07-12 17:05:36 -04:00
deathbearbrown 4ef011ffcf add esid to array/prototype/toLocaleString tests 2017-07-12 17:05:28 -04:00
deathbearbrown 7c3675494a add esid to array/prototype/sort tests 2017-07-12 17:05:18 -04:00
deathbearbrown 474237a725 add esid to array/prototype/some tests 2017-07-12 17:05:07 -04:00
deathbearbrown da291ca3b1 add esid to array/prototype/shift tests 2017-07-12 17:04:32 -04:00
deathbearbrown a62da2b499 add esid to array/prototype/reverse tests 2017-07-12 17:04:18 -04:00
deathbearbrown 4a9c9e9886 add esid to array/protoype 2017-07-05 10:10:28 -04:00
deathbearbrown 1122913fd9 add esid to array/prototype/slice tests 2017-06-30 15:08:08 -04:00
Sue Lockwood 73ec5e6cd9 add esid to array/prototype/reduceRight tests (#1118) 2017-06-30 10:45:25 -04:00
Sue Lockwood 051bbb88ff add esid to array/prototype/reduce tests (#1117) 2017-06-30 10:45:16 -04:00
Sue Lockwood 5ff6550197 add esid to array/prototype/push tests (#1116) 2017-06-30 10:42:59 -04:00
Sue Lockwood d6b492205d add esid to array/prototype/pop tests (#1115) 2017-06-30 10:42:52 -04:00
Sue Lockwood a6a3cf74c4 add esid to array/prototype/map tests (#1114) 2017-06-30 10:42:44 -04:00
Sue Lockwood d22b84173e add esid to array/prototype/lastIndexOf tests (#1113) 2017-06-30 10:42:36 -04:00
Sue Lockwood 7457fe6608 add esid to array/prototype/keys test (#1112) 2017-06-30 10:42:28 -04:00
Sue Lockwood 4fe640b297 add esid to array/prototype/join (#1111) 2017-06-30 10:42:18 -04:00
Sue Lockwood 54e6302219 add esid to array/prototype/indexOf (#1110) 2017-06-30 10:42:06 -04:00
Sue Lockwood f5a5bdebb8 add esid to array/prototype/forEach tests (#1106) 2017-06-30 10:37:24 -04:00
Sue Lockwood 3aa94e2f08 add esid to array/prototype/findIndex tests (#1105) 2017-06-30 10:37:06 -04:00
Sue Lockwood 82e53e14c3 add esid to array/prototype/find tests (#1104) 2017-06-30 10:36:54 -04:00
Sue Lockwood f395b67d29 add esid to array/prototype/filter tests (#1102) 2017-06-30 10:36:17 -04:00
Sue Lockwood 6155f6161a add esid to array/prototype/fill tests (#1101) 2017-06-30 10:33:46 -04:00
Sue Lockwood 6443c43532 add esid to array/prototype/copyWithin (#1100) 2017-06-30 10:33:19 -04:00
Sue Lockwood 69d85e2622 add esid to array/prototype/entries (#1099) 2017-06-30 10:32:35 -04:00
Sue Lockwood e9c50b3ac2 add esid to array/prototype/every (#1098) 2017-06-30 10:32:12 -04:00
deathbearbrown c30216b959 add esid to array/prototype/concat 2017-06-29 17:47:51 -04:00
deathbearbrown 005e570f7c add esid to Array/of 2017-06-29 17:29:17 -04:00
deathbearbrown 1341088b36 add esid to frontmatter for Array/length 2017-06-29 17:28:20 -04:00
deathbearbrown 2f4d0be4b8 Add esid to Array/isArray front matter 2017-06-29 17:24:52 -04:00
Rick Waldron e5ffc904d6 Adding Symbol to Array.prototype.sort "throws on a non-undefined non-function" (#1066)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-06-28 10:34:05 -04:00
Sue Lockwood b07621ded1 update Array/From files ESID to sec-array.from (#1077) 2017-06-27 17:12:06 -04:00
Jordan Harband f1c1b33b53 Array.prototype.sort and %TypedArray%.prototype.sort should throw on a non-undefined non-function (#1059)
Per https://github.com/tc39/ecma262/pull/785/
2017-06-12 19:21:33 -03:00
Leo Balter 715b9052cf
Remove unnecessary tests
These tests are not adding any coverage to the respective API they
should be covering.

There are other files checking cases for array-like objects, and
playing this with the global might cause issues and unnexpected
behavior on specific environments like browsers.
2017-05-17 15:27:51 -04:00
André Bargull 947bf6d3e2 Add tests for Array.prototype methods when length property exceeds safe integer limit (#1028) 2017-05-10 12:20:06 -04:00
Rick Waldron 6fc8082e64 Merge pull request #963 from leobalter/prop-descs
Cleanup prop desc tests in the Array folder
2017-04-28 14:51:57 -04:00
Leo Balter d6efc316ed
Update some tests to avoid $ERROR 2017-04-25 15:18:27 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Leo Balter 7972f9bbdc
Add and update common tests for Array and Array.prototype
Ref #960
2017-04-11 03:01:00 -04:00
Leo Balter c58738e041
Add test for Array.name 2017-04-11 02:34:04 -04:00
Leo Balter 0546fb2f52
Update tests for Array.length 2017-04-11 02:34:03 -04:00
Leo Balter e98ccd13ef
Move tests for Array `length` to a proper folder 2017-04-11 02:33:44 -04:00
Leonardo Balter 340543bc11
Rename top level 'name' and 'length' bindings
Fix 850
2017-03-14 12:43:24 -04:00
Leo Balter c062d93012 Add Infinity test cases to Array.prototype.copyWithin (#882)
Fixes #861
Ref #849

Based on the cases from TypedArray.prototype.copyWithin
2017-03-13 10:50:10 -07:00
Rick Waldron fdd2fa9b1c Rename $ => $262. Fixes gh-802 (#823)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-03-01 16:34:15 -05:00
Corey Frang 8a0563dd5e Remove old test file (now using the named version) 2017-01-31 10:55:58 -05:00
Corey Frang 80b091ce2d Add Array.prototype.every.length tests 2017-01-31 10:55:58 -05:00
Lyza Danger Gardner d13565ab05 Rename 2017-01-20 16:06:46 -05:00
Lyza Danger Gardner da6657c94c Add descriptor tests for sec-array.isarray 2017-01-20 16:06:46 -05:00
jugglinmike 71e573f7da Add tests for realm interactions (#688)
* Add tests for prototype realm inference

* Add tests for miscellaneous realm concerns

* Add tests for realm of spec-created Errors

In some cases, Error objects produced by the specification are
observable from ECMAScript code. Among these cases, some are further
differentiated in that they occur outside of any built-in function and
may be triggered through syntactic production directly. The current
realm record is commonly interpreted incorrectly under these
circumstances.

Add tests asserting that the expected realm record is used when
constructing such Error objects.

* Add tests for realm use in ArraySpeciesCreate

* Add tests for function realm retrieval

* Add tests for cross-realm behaviors of Symbols

* Add tests for GetValue and PutValue

* Add tests for realm of spec-created Arrays

In some cases, Arrays produced by CreateArrayFromList are observable
from ECMAScript code. Among these cases, two occur outside of any
built-in function and may be triggered through syntactic production
directly. The current realm record is commonly interpreted incorrectly
under these circumstances.

Add tests asserting that the expected realm record is used when
constructing arrays.

* Add test for spec-created object

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for prototype realm inference

* fixup! Add tests for miscellaneous realm concerns
2016-10-24 10:43:17 -07:00
Viktor 22f8df2315 Update S15.4.4.11_A7.2.js (#777)
`Array.prototype.sort` should be used instead of `Array.sort`
2016-10-19 14:00:35 -07:00
Leo Balter e49d2661a8 Improve assertions comparing values to NaN (#690)
The global isNaN is not precise at all, and Number.isNaN is an ES6 feature that makes it preferrable to use assert's sameValue for NaN values, as it handles it internally using the comparison.
2016-07-01 11:22:55 -07:00
Leonardo Balter ac628975a3
Remove unused variables
Fixes gh-597
2016-06-21 13:03:22 -04:00
jugglinmike ee7496f713 Add tests for usage of IsArray (#667) 2016-06-10 15:07:40 -04:00
Leonardo Balter c7f9b12cc4 Add tests for Array.prototype.includes 2016-06-01 15:35:00 -04:00
jugglinmike 4980fd264e Add tests for ArraySpeciesCreate (#600)
Assert the expected behavior of the ArraySpeciesCreate abstract
operation in the 5 Array instance methods from which it is invoked.

This change set does not include tests for ECMAScript realm
considerations because Test262 does not currently expose a mechanism for
interfacing with realms.
2016-05-03 12:42:38 -04:00
Gorkem Yakin 85e6ab8e15 Merge branch 'bocoup/species-accessor-values' 2016-04-25 16:59:44 -07:00
Mike Pennisi b8e40a6f3f Add tests for return value of @@species accessors 2016-04-25 16:59:23 -07:00
Mike Pennisi eb644bb2da Reduce reliance on `fnGlobalObject.js`
This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
2016-04-25 11:09:21 -07:00
Leonardo Balter e451026965 Fix minor typo on a test for Array#fill 2016-04-12 19:48:54 -04:00
Leonardo Balter c15079e741 Remove surface tests for %TypedArray%.prototype.toString
Because Test262 asserts the strict equality of
`Array.prototype.toString` and `TypedArray.prototype.toString`, tests
for properties of the object do not need to be reproduced in both
location.

Ref gh-526
2016-04-07 11:36:15 -04:00
Leonardo Balter bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
Leonardo Balter 26785d40ca Add tests for zero conversion on Array#indexOf and Array#lastIndexOf
Fixes #435
2016-02-05 19:17:26 -02:00
Tom Schuster 97c61513d8 Stop test262 from hanging Spidermonkey with an unimportant error message 2016-01-23 17:41:59 +01:00
André Bargull ca61d9b876 Add missing tests for "length" and "name" properties of built-in functions
Note: Already uses the updated DataView function lengths from tc39/ecma262#266 (ES2016 Draft 2015-12-20)
2016-01-15 18:12:05 +01:00
André Bargull 5e3eed63b9 Move Symbol.species and AnnexB tests to new subfolders 2016-01-15 18:11:03 +01:00
Mike Pennisi e39f8d88c5 Add tests for well-known Symbol: @@unscopables 2015-10-05 11:57:31 -04:00
André Bargull df9bf58204 Tests for changes introduced in ES2015 (Annex E)
- String case functions iterate over code points
- Has called before Get in Array.p.reverse
- Add test for web-compat Array.p.splice behaviour; Plus missing test for no arguments case
- ToObject no longer applied to this-value in Array.p.toLocaleString
- ToObject no longer applied to this-value in Object.p.toLocaleString
- Add tests for Object.p.propertyIsEnumerable and symbol property keys
- Add tests for Object.p.hasOwnProperty and symbol property keys
- Test property descriptor attributes of message property
- Tests for RegExp constructor checks
- Date constructor when called with date object
- TimeClip never returns negative zero
2015-09-07 17:25:55 +02:00
Rick Waldron 9ccc663936 Merge pull request #415 from anba/remove-runTestCase-finally
Replace runTestCase when used with try-finally
2015-09-04 15:20:26 -04:00
Rick Waldron f74b1cb02c Remove leftover "includes: [runTestCase.js]" 2015-09-04 13:46:54 -04:00
Rick Waldron a2554d909b Merge branch 'remove-runTestCase-builtins-other' of https://github.com/anba/test262 into anba-remove-runTestCase-builtins-other
# By André Bargull
# Via André Bargull
* 'remove-runTestCase-builtins-other' of https://github.com/anba/test262:
  Replace runTestCase with assert helpers, rest [test/built-ins]
  Replace runTestCase with assert helpers [test/built-ins]

Conflicts:
	test/built-ins/Array/from/S22.1.2.1_T1.js
	test/built-ins/Array/from/S22.1.2.1_T2.js
	test/built-ins/Array/from/S22.1.2.1_T3.js
2015-09-04 13:25:41 -04:00
Rick Waldron e80b669a37 Merge pull request #404 from bocoup/update-array-from
Update tests for Array.from
2015-09-02 17:37:30 -04:00
Leonardo Balter 3bdc467c51 Update tests for Array.from
- fixed a false positive where argument-passed-null.js was returning a TypeError from 22.1.2.1 step 5
- created 2 tests from argument-passed-null to assert this as null and items as null
- fixed reference info on Array.from_arity.js
- fix tests at Array.from_forwards-length-for-array-likes
- static checks on calling-from-valid-1-onlyStrict.js
- static checks on calling-from-valid-1-noStrict.js
- static checks on calling-from-valid-2.js
- removed create-typedarray-from.js, that test belong to es6id 22.2.2.1
- removed mapfn-invalid-typeerror-1.js - false positive from 22.1.2.1 step 5
- moved mapfn-invalid-typeerror-2.js to more spread tests where mapfn is not callable
- ...
2015-09-02 17:36:11 -04:00
Rick Waldron 574c87b167 Merge pull request #390 from bocoup/Array.prototype.copyWithin
Add tests for Array.prototype.copyWithin
2015-09-02 17:16:07 -04:00
Dan Ehrenberg a58a3a0ad9 Fix Array.from_arity test
An extra newline in a comment prevented the import from being parsed properly.
2015-08-25 14:37:37 -07:00
André Bargull 4ec97779fd Replace runTestCase with assert helpers, rest [test/built-ins] 2015-08-13 17:57:23 +02:00
André Bargull 1b14708467 Replace runTestCase with assert helpers [test/built-ins] 2015-08-13 17:50:58 +02:00
André Bargull 52a706c022 Replace runTestCase with assert, try-finally, [test/built-ins/Array] 2015-08-13 17:42:40 +02:00
André Bargull edc902aff5 Replace runTestCase with assert.throws [test/built-ins/Array] 2015-08-11 17:44:26 +02:00
André Bargull a3bfd5a61f Replace runTestCase with assert helpers [test/built-ins/Array] 2015-08-06 18:19:54 +02:00
André Bargull 174f24b2f3 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/reduceRight] 2015-08-06 18:19:31 +02:00
André Bargull df43797c70 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/reduce] 2015-08-06 18:18:58 +02:00
André Bargull 976a687b27 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/map] 2015-08-06 18:18:33 +02:00
André Bargull e2e4fa4c93 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/filter] 2015-08-06 18:17:56 +02:00
André Bargull 354b7cc11b Replace runTestCase with assert helpers [test/built-ins/Array/prototype/lastIndexOf] 2015-08-06 18:17:18 +02:00
André Bargull 7510a91a7e Replace runTestCase with assert helpers [test/built-ins/Array/prototype/indexOf] 2015-08-06 18:16:54 +02:00
André Bargull 659aa4c0f8 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/some] 2015-08-06 18:16:23 +02:00
André Bargull a87aedd8a5 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/every] 2015-08-06 18:15:59 +02:00
André Bargull e8246fd9f0 Replace runTestCase with assert helpers [test/built-ins/Array/prototype/forEach] 2015-08-06 18:14:23 +02:00
André Bargull da6c9b964c Remove invalid Array.from test 2015-08-05 07:25:31 +02:00
unknown e3cf0acb1c update tests for Array.from 2015-08-03 18:20:24 +08:00
Leonardo Balter e72f4bcd62 fixup! Add tests for Array.prototype.copyWithin 2015-07-31 16:46:46 -04:00
Leonardo Balter 2a32ff4a66 fixup! Add tests for Array.prototype.copyWithin 2015-07-31 16:44:28 -04:00
Brian Terlson d40961b334 Merge pull request #378 from bocoup/Array.of
Add tests for Array.of
2015-07-27 17:27:20 -07:00
Brian Terlson a89613b4f1 Merge pull request #388 from bocoup/array-find-and-findindex
Update tests for Array#find and Array#findIndex
2015-07-27 17:27:16 -07:00
Leonardo Balter 9ed21dc963 Update tests for Array.of 2015-07-27 20:19:09 -04:00
Leonardo Balter 6a440ee616 Update tests for Array.prototype.findIndex 2015-07-27 20:17:43 -04:00
Leonardo Balter 88435c5201 Update tests for Array.prototype.find 2015-07-27 20:17:43 -04:00
Leonardo Balter e64e17f750 Add and update tests for Array.prototype.fill 2015-07-27 20:16:39 -04:00
Leonardo Balter 935da0827b Add tests for Array.prototype.copyWithin 2015-07-27 20:14:45 -04:00
Brian Terlson 02fbde769c Merge pull request #381 from bocoup/array-iterator-methods
Add and update tests for Array.prototype iterator methods.
2015-07-27 17:08:19 -07:00
Brian Terlson 791b25ebbc Merge pull request #377 from bocoup/symbol-iterator
Add tests for @@iterator
2015-07-27 16:45:51 -07:00
Mike Pennisi 71fa7b570c Add tests for @@isConcatSpreadable 2015-07-24 14:42:35 -04:00
Brian Terlson 2284a46ebf Merge pull request #385 from anba/license
Change license headers to standard format
2015-07-17 11:03:07 -07:00