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
Currently the library only tests the
RegexLiteralsversions. Ideally, the library should test all Regexes including those written in the Swift DSL (in theRegexBuildersnamespace).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.ssnas we use to testRegexLiterals.ssn. Currently this isn't possible. The reason is becauseRegexandRegexComponentare notSendable. If it were, we could pass it into the test as a parameter, in the same way that we pass theStrings 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
AnyRegexComponenttype that could beSendable. Using this, perhaps we could have reusable tests.Additional Context