Commit Graph

65 Commits

Author SHA1 Message Date
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Leonardo Balter a7ee8fb735
Fix invalid String#indexOf test in a coercible Date instance
Fixes #793

As described by @ediosyncratic:

Date(0) flows through the given algorithm to ToDateString, which should:

> Return an implementation-dependent String value that represents tv as
> a date and time in the current time zone using a convenient, human-readable form.

The string is implementation-dependent and there is nothing constraining it to use
a two-digit day-of-month (so "Thu Jan 1, 1970, 0:0:0" would be valid), much less to
position it at index 8.
2017-03-13 19:07:06 -04: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
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
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
Mathias Bynens 3a5a09eba2 Ensure U+180E is no longer considered whitespace
Ref. https://hashseed.blogspot.com/2014/08/in-ecma-262-5.html
Ref. https://github.com/tc39/ecma262/pull/300#issuecomment-181376767
Ref. 9b10d2a597

Fix and add @anba’s U+180E tests
2016-07-06 10:11:32 -04:00
jugglinmike f554f68ae9 Improve coverage for section 21: String (#712)
This changeset increases coverage for section 21, specifically "21.1 String
Objects".

* Add tests for "this" validation of String methods

* Add tests for ToNumber as used by String methods

* Add test for `length` prop of exotic String objs

* fixup! Add test for `length` prop of exotic String objs
2016-07-05 14:04:31 -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
Ian Halliday 022888be9e Remove duplicate front matter keys (#621)
Fixes #620
2016-05-06 13:41:33 -04:00
Gorkem Yakin 7f88f29328 Merge branch 'bocoup/global-object' 2016-04-25 11:09:49 -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
Mike Pennisi 3d68fcc063 Increase coverage for Symbol constructor
Add new tests for invocation requirements; re-organize existing files
according to the language feature under test.
2016-04-25 10:59:22 -07:00
Jordan Harband c95e673feb Add tests for `String#padStart` and `String#padEnd`.
https://github.com/tc39/proposal-string-pad-start-end/issues/23

Closes gh-564
2016-04-06 15:13:52 -04:00
Mike Pennisi 071b5f03c6 Remove unused harness file
The harness file `Test262Error.js` has not contained executable code since it
was introduced in this project [1]. The definition of the `Test262Error`
function has consistently been located in the `sta.js` harness file which test
runners are expected to inject into the test environment.

Remove the file and all references to it.

[1] See commit c33bf0e043
2016-02-12 13:44:18 -05: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 1da4c78051 Revert primitive wrapper prototypes and String#split to ES5
- Revert Number, Boolean and String prototypes to ES5 semantics
- Revert String.prototype.split's to ES5 behavior
2015-11-06 18:50:44 +01:00
Gorkem Yakin df1d78d10f Merge pull request #399 from bocoup/symbol-match
Add tests for @@match
2015-09-14 14:29:28 -07:00
Mike Pennisi 62d5787b09 Add tests for @@match
Introduce tests for the well-known Symbol, `@@match`. This effects the
behavior of `String.prototype.match` and is also used by the IsRegExp
abstract operation.
2015-09-14 17:16:37 -04:00
Gorkem Yakin 32efa4a289 Merge pull request #407 from bocoup/symbol-split
Add tests for well-known Symbol: @@split
2015-09-10 16:57:00 -07:00
Mike Pennisi 8879cde471 Add tests for well-known Symbol: @@search 2015-09-08 19:15:19 -04:00
Rick Waldron acf2d0cb11 Merge pull request #408 from anba/es2015_changes
Tests for changes introduced in ES2015 (Annex E)
2015-09-07 15:32:36 -04:00
André Bargull 3a30a72269 Add tests for special case mappings 2015-09-07 18:22:07 +02: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 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 a2a92d0765 Merge pull request #402 from bocoup/symbol-replace
Add tests for well-known Symbol: @@replace
2015-09-02 17:20:17 -04:00
André Bargull 1b14708467 Replace runTestCase with assert helpers [test/built-ins] 2015-08-13 17:50:58 +02:00
André Bargull 589b638ab5 Replace runTestCase with assert.throws [test/built-ins] 2015-08-11 17:44:37 +02:00
André Bargull b1ecdd00e8 Replace runTestCase with assert helpers [test/built-ins/String] 2015-08-06 18:23:58 +02:00
Mike Pennisi 4693197b0c Add tests for well-known Symbol: @@split 2015-08-06 09:52:51 -04:00
Mike Pennisi bb0cbeb655 Add tests for well-known Symbol: @@replace 2015-08-05 09:39:00 -04:00
Brian Terlson 791b25ebbc Merge pull request #377 from bocoup/symbol-iterator
Add tests for @@iterator
2015-07-27 16:45:51 -07:00
Brian Terlson cd4461c89e Merge pull request #380 from bocoup/String.prototype.endsWith
Add and update tests for String.prototype.endsWith
2015-07-24 12:51:52 -07:00
Leonardo Balter 33c791e722 String.prototype.startsWith 2015-07-24 15:29:35 -04:00
Leonardo Balter cc4230564a String.prototype.endsWith 2015-07-24 15:28:35 -04:00
Leonardo Balter 096b31a05b String.prototype.includes 2015-07-23 18:50:59 -04:00
Brian Terlson 57b3d1752b Merge pull request #366 from bocoup/String.prototype.repeat
Add tests for String.prototype.repeat
2015-07-22 17:13:44 -07:00
Brian Terlson cdc6be9631 Merge pull request #359 from bocoup/String.raw
Add tests for String.raw
2015-07-21 13:02:49 -07:00
Leonardo Balter 95349fcb2c String.prototype.normalize 2015-07-21 13:58:37 -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
Brian Terlson 28089fe079 Merge pull request #365 from bocoup/codePointAt
Add tests for String.prototype.codePointAt
2015-07-17 11:01:58 -07:00
André Bargull 023c7aa69e - Remove inline license
- Remove duplicate word
- Add missing license
2015-07-17 19:55:00 +02:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
Leonardo Balter c6c61bd50d String.prototype.codePointAt 2015-07-16 18:49:40 -04:00
Mike Pennisi 741b799286 Add tests for String.prototype[Symbol.iterator] 2015-07-16 13:05:17 -04:00
Leonardo Balter 3ffca82742 String.prototype.repeat 2015-07-14 17:54:02 -04:00
Leonardo Balter 91900ab646 String.raw 2015-07-10 14:33:19 -04:00
Leonardo Balter 57b7d13781 String.fromCodePoint 2015-07-10 14:30:27 -04:00
Pieter van Ginkel ad1f14c247 ES6 specific functions should declare a feature.
The String.endsWith and String.includes tests didn't specify either an es6id or a features. Added a features attribute for these tests.
2015-07-05 15:54:28 +02: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
Mike Pennisi fe11a1ea1a Remove $PRINT helper function
The `$PRINT` helper function has no effect on test behavior. The
following tests use it to report assertion outcomes (and as a result
will fail silently):

- test/language/function-code/S10.2.1_A4_T2.js
- test/language/function-code/S10.2.1_A5.1_T1.js
- test/language/function-code/S10.2.1_A5.1_T2.js
- test/language/function-code/S10.2.1_A5.2_T1.js

Remove the function definition and all references within tests. Update
tests that use it as an error reporting mechanism to instead use an
appropriate `assert` helper function.
2015-06-16 13:43:23 -04:00