Skip to content

Port Test262’s RegExp lookbehind tests - #37928

Merged
foolip merged 1 commit into
web-platform-tests:masterfrom
mathiasbynens:javascript-regexp-lookbehind
Jan 16, 2023
Merged

foolip merged 1 commit into
web-platform-tests:masterfrom
mathiasbynens:javascript-regexp-lookbehind

Conversation

@mathiasbynens

@mathiasbynens mathiasbynens commented Jan 13, 2023 •

Copy link
Copy Markdown
Contributor

This patch ports the tests from https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/lookBehind into WPT.

Any uses of the following Test262 harness APIs have been replaced with the corresponding WPT testharness.js API:

  • assert.compareArray → assert_array_equals
  • assert.sameValue → assert_equals

The tests pass in Chrome and Firefox.

This is motivated by the proposal to include RegExp lookbehind functionality in Interop 2023, which would require WPT coverage since Test262 results cannot yet be consumed / reported by the wpt.fyi & Interop dashboards.

@wpt-pr-bot

Copy link
Copy Markdown
Collaborator

There are no reviewers for this pull request. Please reach out on the chat room to get help with this. Thank you!

@mathiasbynens

mathiasbynens commented Jan 13, 2023 •

Copy link
Copy Markdown
Contributor Author

Question to reviewers: stable Safari doesn’t yet support lookbehinds, and throws an early parse error when it encounters the first lookbehind in JS source. As a result, the test harness report page remains blank. Is this acceptable to convey the “fail” state?

(If we wanted the harness to show up, we’d have to turn all RegExp literals using lookbehinds into a string literal passed to the RegExp() constructor within a try-catch, with the catch handling the case of no parsing support.)

Comment thread ecmascript/regexp-lookbehind.html Resolved
This patch ports the tests from [1] into WPT.

Any uses of the following Test262 harness APIs have been replaced with the corresponding WPT testharness.js API:

- `assert.compareArray` → `assert_array_equals`
- `assert.sameValue` → `assert_equals`

The tests pass in Chrome and Firefox.

[1]: https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/lookBehind
@mathiasbynens
mathiasbynens force-pushed the javascript-regexp-lookbehind branch from d12cfa8 to 1f9fe74 Compare January 13, 2023 11:39

@jgraham jgraham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

@foolip

foolip commented Jan 16, 2023

Copy link
Copy Markdown
Member

Question to reviewers: stable Safari doesn’t yet support lookbehinds, and throws an early parse error when it encounters the first lookbehind in JS source. As a result, the test harness report page remains blank. Is this acceptable to convey the “fail” state?

Since it's already fixed in STP I think that's OK, yeah. It's certainly not the best failure more, but good enough for something that's being fixed.

@foolip
foolip merged commit 34faeb4 into web-platform-tests:master Jan 16, 2023
@mathiasbynens
mathiasbynens deleted the javascript-regexp-lookbehind branch January 16, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants