Skip to content

Add scalable testing #1

@DandyLyons

Description

@DandyLyons

Currently the library only tests the RegexLiterals versions. Ideally, the library should test all Regexes including those written in the Swift DSL (in the RegexBuilders namespace).

But I would like to do this in a way that is scalable and does not require rewriting tests. In other words it should be possible to use the same test to test RegexBuilders.ssn as we use to test RegexLiterals.ssn. Currently this isn't possible. The reason is because Regex and RegexComponent are not Sendable. If it were, we could pass it into the test as a parameter, in the same way that we pass the Strings to make reusable tests.

If we rewrote the tests by hand, this would work, but inevitably the tests would be out of sync and less reliable. It would also be more of a hassle to contributors.

Possible Solutions

It's possible that we could create a concrete type-erased AnyRegexComponent type that could be Sendable. Using this, perhaps we could have reusable tests.

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions