Skip to content

[Question] Format for Unicode property escape test suite? #950

@mathiasbynens

Description

@mathiasbynens

As part of my work on the Unicode property escapes in regular expressions proposal, I’m planning to contribute tests for this feature. (Ref. tc39/proposal-regexp-unicode-property-escapes#4.)

My plan was to create a script (hosted in its own, separate repo) that generates the tests based on a given Unicode version, so they could easily be updated + upstreamed to test262. (Note that the Unicode standard is updated every year, and thus, so should the tests.) I would be maintaining this script and submitting PRs with the updated tests to test262 every year.

Now, because these tests will be generated programmatically, they can be as exhaustive as we want them to be. We can do better than randomly testing a couple of properties and symbols, which doesn’t guarantee 100% spec compliance. Ideally, every Unicode symbol would be tested against every supported property escape. This would ensure 100% interoperability (assuming all major engines run tests262 tests). The downside would be that these tests would potentially take a long time to run. @syg, @tcare: thoughts?

Here’s an exhaustive list of the supported properties per this proposal (as per the current version): https://github.com/mathiasbynens/regexpu-core/blob/master/property-escapes.md

My questions:

  1. Would such a test suite make sense as part of test262?
  2. If so, what would the directory/file structure look like? Some options:
    • A separate *.js file for each individual property escape?
    • A separate file for every 0xFFFF code points (i.e. every Unicode plane)?
    • Is there a better idea?

Any feedback is welcome.

cc @leobalter @jugglinmike @littledan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions