Commit Graph

187 Commits

Author SHA1 Message Date
Leo Balter 0fd3cf4d24
Some cleanup follow ups (#2351) 2019-09-18 14:15:53 -03:00
Ron Buckton 1056d8fde9 Add tests for regexp-match-indices (#2309)
* Add tests for regexp-match-indices

* Add tests for unicode matches based on presence of /u flag

* Added deepEqual helper, PR feedback
2019-09-18 13:39:12 -03:00
Leo Balter ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Mathias Bynens a9abd418cc Update RegExp property escape tests per Unicode v12.1.0 (#2161)
Ref. https://github.com/tc39/ecma262/issues/1530.
2019-05-22 17:08:14 -04:00
Mathias Bynens 9339f8a5ce Update RegExp Unicode property escape tests per Unicode 12 (#2091)
1cfedb79bb
https://github.com/tc39/ecma262/issues/1467
https://github.com/tc39/ecma262/pull/1468
2019-03-12 04:47:27 -04:00
Mike Pennisi cc09757478 Test forward slash in RegularExpressionClassChar 2019-02-14 15:21:42 -05:00
Leo Balter e403eea331 Fix false positives 2018-12-21 10:50:23 -05:00
Leo Balter dec4e5df74
Merge pull request #1801 from mathiasbynens/issue-1634
Move `throw "…"` for negative parsing errors to a helper function
2018-11-13 17:23:09 -05:00
Rick Waldron b1e15cd326
Merge pull request #1923 from bakkot/less-regex-eval
Reduce uses of `eval` for regex literal syntax
2018-11-08 09:18:48 -05:00
Kevin Gibbons 0160cab518 fix missing/duplicate tests 2018-11-07 13:52:44 -08:00
Mathias Bynens e558b29b69
Optimize character class escape tests
Previously, these tests simply compared against an equivalent regular expression pattern by generating a large string containing either all code points up to U+FFFF or U+10FFFF, depending on the `u` flag, and then performing:

    str.replace(re, '') === str.replace(otherRe, '');

These two `String#replace` calls can be optimized into a single `RegExp#test` call by following the pattern used in the property escapes tests at https://github.com/mathiasbynens/unicode-property-escapes-tests.
2018-11-06 16:14:14 -08:00
Mathias Bynens 01550ab13a
Sync with https://github.com/bocoup/test262-regexp-generator/pull/1 2018-11-06 15:24:07 -08:00
Kevin Gibbons e80d8a184a split unicode-property-names.js 2018-11-05 15:34:03 -08:00
Kevin Gibbons 9bc9116656 split unicode-malformed.js 2018-11-05 15:23:03 -08:00
Kevin Gibbons 296f47a008 split non-unicode-property-names.js 2018-11-05 15:12:23 -08:00
Kevin Gibbons de339e98d6 split non-unicode-malformed.js 2018-11-05 14:58:03 -08:00
Richard Gibson 5b3d429e28 Move cross-realm tests into their own files 2018-11-02 14:39:23 -04:00
Richard Gibson 6da621f161 Assert error when invoking any %RegExpPrototype%-aware getter on cross-realm RegExp.prototype 2018-11-02 14:39:23 -04:00
Richard Gibson 9e0410814a Test cross-realm use of RegExp source getter in both directions 2018-11-02 14:39:23 -04:00
Richard Gibson 823af01575 Assert error when invoking RegExp source getter on cross-realm RegExp.prototype
RegExp.prototype is not a RegExp, and the algorithm only special-cases
(same-realm) %RegExpPrototype%.
2018-11-02 14:39:23 -04:00
Mathias Bynens b9daa57dcb Rename to $DONOTEVALUATE per @leobalter's suggestion 2018-10-23 13:51:17 +02:00
Mathias Bynens e3feffb01e Move `throw "…"` for negative parsing errors to a helper function
Closes #1634.
2018-10-23 13:51:16 +02:00
André Bargull faed4fb089 Fix various test issues 2018-10-17 07:45:33 -07:00
Leo Balter d544eacedf
assert calls order for Symbol.match on matchAll usage (#1795)
Fix #1794
2018-09-26 11:37:19 -04:00
André Bargull 3febd4c536 Update matchAll tests to reflect latest spec proposal 2018-09-26 10:38:35 -04:00
André Bargull 8879820a8f Make RegExp/CharacterClassEscapes tests faster across all engines 2018-08-17 07:48:42 -07:00
Leo Balter 0fde488bb4
Update tests for CharacterClassEscapes in RegExps (#1611) 2018-07-09 12:30:33 -04:00
Mathias Bynens c7ac073e73 Update tests for RegExp Unicode property escapes (#1633)
62cbe2f1cb
2018-07-09 12:26:53 -04:00
Leo Balter 012114a6c7 Update non whitespace RegExp tests 2018-06-18 15:53:08 -04:00
Rick Waldron f90a52b396
Merge pull request #1587 from peterwmwong/update-matchall
Update tests for String.prototype.matchAll
2018-06-07 23:15:50 -04:00
peterwmwong bbad9482e6 Update tests for String.prototype.matchAll
As per spec changes (https://github.com/tc39/proposal-string-matchall/pull/35), removed tests related to the removed IsRegExp call.
To prevent older implementations (not observing spec change) from passing, added a new test to verify the reduced number of observable calls to IsRegExp.

Also fix a misreference in `features` frontmatter.
2018-06-07 21:23:54 -05:00
Mathias Bynens 85d595effa Update RegExp Unicode property escape tests per Unicode 11
Emoji data is now published as part of the Unicode standard itself, and thus follows the same version number.

Ref. f302c60c84.
Ref. https://github.com/tc39/ecma262/pull/1218.
Ref. https://github.com/tc39/ecma262/issues/1219.
2018-06-07 15:32:41 +02:00
peterwmwong f1e45d9e5e
Fleshed out tests for Symbol.matchAll, String.p.matchAll, RegExp.p[@@matchAll], and %RegExpStringIteratorPrototype%
Tests were updated and assuming https://github.com/tc39/proposal-string-matchall/pull/33 will be merged.
2018-03-17 22:48:31 -05:00
Jordan Harband e15be1853b
String.prototype.matchAll: add tests for stage 3
`RegExp.prototype[Symbol.matchAll]`: Add basic tests.
2018-01-25 23:45:12 -08:00
Leo Balter ac55e29ed0 Fix yaml consistency 2018-03-06 14:36: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 f717982c94 Remove unused includes 2018-01-25 13:59:37 -05:00
André Bargull 8b50602099 Replace Annex-B __proto__ with Object.[gs]etPrototypeOf 2018-01-25 13:59:37 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Mathias Bynens 7446e885e9 [regexp-named-groups] Expand tests for `groups` property
The `groups` property must be created unconditionally. https://github.com/tc39/proposal-regexp-named-groups/pull/40
2017-12-20 15:33:37 -05:00
André Bargull 2d6a356699 Move incomplete_hex_unicode_escape.js to annexB
Fixes #1313
2017-11-01 08:23:43 -07:00
Mathias Bynens 4e7ed93da8
RegExp property escapes: test Extended_Pictographic 2017-10-22 10:05:05 -07:00
Zirak d36a1777b4 Test for proper handling of incomplete hex escapes (#1274)
See relevant firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1408452
2017-10-16 13:04:51 -04:00
Daniel Ehrenberg e6df79231d Update RegExp named capture tests for spec change (#1270)
The RegExp named groups specification has changed to not throw
errors in certain cases. This patch updates the test262 tests to match
the new specification, and throws in an additional test that verifies
the interaction between named group syntax and other replacement.
The tests pass on a version of V8 which implements the new semantics.

92ceba518c
2017-10-13 14:16:16 -04:00
Leo Balter c969153145 Fix a test looping for space separator chars 2017-09-26 14:13:29 -04:00
Leo Balter 60782de95e Tag tests for U+180E and complete coverage for RegExp matching 2017-09-25 15:27:59 -04:00
Leo Balter 7cbbe51216 Add cross-realm feature 2017-09-22 15:29:10 -04:00
André Bargull 804e008310 Split Annex-B parts of non-unicode-malformed.js into annexB folder 2017-09-18 14:39:32 -04:00
Leo Balter 1bdddabf97 Add missing Symbol.split feature flags 2017-09-08 10:13:50 -04:00
Leo Balter a9099c1f20 Add missing Symbol.replace feature flags 2017-09-08 10:13:50 -04:00
Leo Balter f52f233934 Add missing Symbol.match feature flags 2017-09-08 10:13:50 -04:00
André Bargull e44d73733b Expect early SyntaxError when character range consists of two character classes 2017-09-05 11:18:06 -04:00
Leo Balter f1d7a67e11 Apply feedback for RegExp.prototype.flags (#1196)
* Apply feedback for RegExp.prototype.flags

Ref #1149
2017-08-23 15:03:28 -04:00
Aleksey Shvayka d91044c788 Improve RegExp.prototype.flags coverage (#1149) 2017-08-23 14:03:01 -04:00
Mathias Bynens 953992d235 Update RegExp Unicode property escape tests per latest proposal & Unicode 10 2017-07-13 12:35:44 -04:00
Aleksey Shvayka 4327cdb207 Improve RegExp.prototype.source coverage (#1145) 2017-07-11 11:14:21 -04:00
Aleksey Shvayka ce0ba9b2e6 add escaped substitution test 2017-06-27 00:45:08 +03:00
Aleksey Shvayka f7b15e18d4 add empty replace test 2017-06-26 18:57:19 +03:00
Aleksey Shvayka cb22dad417 add empty references tests 2017-06-26 18:35:16 +03:00
Aleksey Shvayka c38f1d12b0 add groups object tests 2017-06-23 22:59:57 +03:00
Mathias Bynens d587abccdb Fix test involving a Unicode property escape in a character class range (#1034)
Thanks to @anba for spotting this: 4843f049fa (r116528031)
2017-05-17 13:07:50 -04:00
Mathias Bynens d5e1150325 Add regular RegExp Unicode property escape tests (#1014)
Ref. https://github.com/mathiasbynens/unicode-property-escapes-tests/pull/8.
2017-05-01 13:25:51 -04:00
Leo Balter ca314476a9 Update RegExp tests for named-capturing and dotAll (#1009)
* Split order tests for RegExp#flags

* small fixes for RegExp named groups

* Remove invalid syntax

* The test mustn't include the global flag
2017-05-01 12:08:31 -04:00
Leo Balter a09f857ed8 Merge pull request #1006 from leobalter/fix-info
Update RegExp#dotAll tests
2017-04-27 19:37:54 -04:00
Leo Balter 0f10d73fef
Split tests and fix actual/expected order 2017-04-27 19:33:42 -04:00
Daniel Ehrenberg 6ee183a057
RegExp lookbehind tests
Tests for the stage 3 proposal at
https://tc39.github.io/proposal-regexp-lookbehind/

Tests ported from V8, written by @hashseed
2017-04-27 19:33:40 -04:00
Leo Balter 7493787a3f
Replace duplicate case 2017-04-27 18:39:37 -04:00
Leo Balter 028d984c0e
Update RegExp#dotAll tests 2017-04-27 18:35:37 -04:00
Leo Balter f2db2b6829
fix metadata for regexp.prototype.dotall 2017-04-27 18:24:48 -04:00
Daniel Ehrenberg bfc9020d51 Tests for RegExp dotAll proposal (#997)
Proposal from @mathiasbynens at https://github.com/tc39/proposal-regexp-dotall-flag and https://tc39.github.io/proposal-regexp-dotall-flag/
2017-04-27 18:20:24 -04:00
Daniel Ehrenberg 6cf15f523a RegExp named group tests (#998)
Tests against the Stage 3 named capture groups proposal
https://tc39.github.io/proposal-regexp-named-groups
2017-04-27 12:50:59 -04:00
Mathias Bynens d354788f6f RegExp property escapes: list emoji data version (UTR51) (#981) 2017-04-18 12:30:35 -04:00
Mike Pennisi 2c0c3e7f96 Correct typo in copyright information 2017-04-18 12:23:22 -04:00
Mathias Bynens 1c1935e363 Remove tests for Unicode properties that are no longer supported (#980)
Ref. https://github.com/tc39/proposal-regexp-unicode-property-escapes/issues/27.
2017-04-15 12:57:32 -04:00
Mathias Bynens 92a85ed8fd Fix `Script_Extensions=Inherited` data (#977)
Ref. https://github.com/mathiasbynens/node-unicode-data/issues/45.
Ref. da8ae69b9b.
Ref. https://github.com/mathiasbynens/unicode-property-escapes-tests/issues/7.
2017-04-14 12:20:05 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Mathias Bynens d993c4a9e8 Fix three broken RegExp property escape tests (#974)
c62ed61cfc
2017-04-13 14:40:18 -04:00
Mathias Bynens 44b40e083e Add exhaustive tests for RegExp Unicode property escapes (#971)
Proposal: https://github.com/tc39/proposal-regexp-unicode-property-escapes

These tests have been generated by the script at https://github.com/mathiasbynens/unicode-property-escapes-tests. They check all the properties and values that should be supported by implementations against the symbols they’re supposed to match. False positives are detected as well.

Ref. #950.
Ref. https://github.com/tc39/proposal-regexp-unicode-property-escapes/issues/4.
2017-04-13 11:22:49 -04:00
littledan 184275fb25 Tests for RegExp capture substitution out of bounds (#925)
In https://github.com/tc39/ecma262/pull/853 , standard semantics
for this case are proposed. This patch tests the case.
2017-03-27 13:53:33 -04:00
André Bargull 6b09ad0459 Update YAML frontmatter of some tests to be compatible with monkeyYaml (#862) 2017-03-01 16:35:37 -05: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
littledan f21ac5609b Fix call to assert.notSameValue (#859)
Thanks to @demurgos for spotting this bug at #858
2017-02-13 13:48:38 -08:00
littledan 91ba9a0a25 Update RegExp tests for the semantics change (#853)
Spec change at https://github.com/tc39/ecma262/pull/798
2017-02-09 12:51:02 -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
Jakob Gruber 81f66a5a3a Tests for new lastIndex semantics (#760)
* Tests for new lastIndex semantics

Add and update tests for the lastIndex semantic change introduced in
https://github.com/tc39/ecma262/pull/627.

* Address comments
2016-09-29 10:41:37 -07:00
Tom Care 8a6d7a49ee Merge pull request #711 from bocoup/audit2016-section-21-regexp
Improve coverage for section 21: RegExp
2016-08-04 16:22:18 -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
Mike Pennisi 4e781091f8 Improve tests for RegExp `lastIndex` property
The prior version of this test asserted only the property's
configurability. It was also limited to the RegExp object as returned
from the RegExp constructor.

Extend the test to verify all values of the property descriptor.
Duplicate these assertions in a separate file dedicated to the RegExp
object as created from a RegExp literal.
2016-06-29 17:29:43 -04:00
Mike Pennisi 1d0dbc5726 Assert absense of internal slot on RegExpPrototype
The previous commit removed two invalid tests designed to ensure that
the RegExpPrototype object is not itself a RegExp object. Introduce a
new test to assert this detail in a way that accounts for the
possibility of host extensions.
2016-06-29 17:29:42 -04:00
Mike Pennisi 9c3bb8d69e Remove invalid tests for %RegExpPrototype%
From ECMA262, section 16:

>  Except as restricted in 16.2, an implementation may provide
>  additional types, values, objects, properties, and functions beyond
>  those described in this specification.

Section 16.2 makes no mention of the `lastIndex` property of the
%RegExpPrototype% intrinsic. It is therefor not a violation to define
%such an "own" property.

Remove the tests that assert otherwise.
2016-06-29 17:29:42 -04:00
Mike Pennisi b9587262d4 Add tests for return value: 'get RegExp.p.source' 2016-06-29 17:29:42 -04:00
Mike Pennisi e1cd1e7f85 Update and tests for %RegExpPrototype% methods
A recent web-compatability change to ECMA262 modified the semantics of
the accessor methods on the %RegExpPrototype% intrinsic--the "get"
accessors now include steps dedicated to the case where the "this" value
is the %RegExpPrototype% object itself.

Remove the tests that have been invalidated by this change, introduce
tests asserting the new behavior, and extend coverage for other possible
"this" values.
2016-06-29 17:07:46 -04:00
jugglinmike d9d3f7cf4f Update RegExp tests (#614)
The RegExpBuiltinExec internal operation was modified in March of 2016
[1]: instead of referencing the `global` and `sticky` properties of the
"this" value, the algorithm now infers those values from the object's
[[OriginalFlags]] internal slot.

This change invalidated a number of tests. In cases where the change
resulted in an observable behavior, update the tests to assert the
latest specification text. In cases where the change removed a
previously-observable behavior, remove the files completely.

Specification text change set:

>        1. Assert: Type(_S_) is String.
>        1. Let _length_ be the number of code units in _S_.
>        1. Let _lastIndex_ be ? ToLength(? Get(_R_, `"lastIndex"`)).
>      - 1. Let _global_ be ToBoolean(? Get(_R_, `"global"`)).
>      - 1. Let _sticky_ be ToBoolean(? Get(_R_, `"sticky"`)).
>      + 1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
>      + 1. If _flags_ contains `"g"`, let _global_ be *true*, else let _global_ be *false*.
>      + 1. If _flags_ contains `"y"`, let _sticky_ be *true*, else let _sticky_ be *false*.
>        1. If _global_ is *false* and _sticky_ is *false*, let _lastIndex_ be 0.
>        1. Let _matcher_ be the value of _R_'s [[RegExpMatcher]] internal slot.
>      - 1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
>        1. If _flags_ contains `"u"`, let _fullUnicode_ be *true*, else let _fullUnicode_ be *false*.
>        1. Let _matchSucceeded_ be *false*.
>        1. Repeat, while _matchSucceeded_ is *false*

[1] https://github.com/tc39/ecma262/pull/494
2016-05-09 19:34:52 -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 bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
Leonardo Balter ebda746e6a Replace es7id tags with id 2016-02-12 16:22:56 -08: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