Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scalable testing #1

Open
DandyLyons opened this issue Aug 31, 2024 · 0 comments
Open

Add scalable testing #1

DandyLyons opened this issue Aug 31, 2024 · 0 comments

Comments

@DandyLyons
Copy link
Owner

DandyLyons commented Aug 31, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant