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

Test PP even if XS available #4

Open
dmacks opened this issue Jun 29, 2023 · 1 comment
Open

Test PP even if XS available #4

dmacks opened this issue Jun 29, 2023 · 1 comment

Comments

@dmacks
Copy link

dmacks commented Jun 29, 2023

When running the self-test suite of match-simple-0.012 without match::simple::XS installed, I get:

t/02simple.t .. # implementation: PP

whereas if I do have m-s-XS installed:

t/02simple.t .. # implementation: XS

So it tests the default mode, and on my platform I can see it does find the ::XS backend, and then successfully tests it. However, this leaves the PP mode, implemented within match::test itself, un-tested. And if ::XS is not available, simply "PP" doesn't help me recognize that there is any other option or that the optional ::XS loader isn't being tested. And all of this is also somewhat at the whim of my local shell env. The result is that the test is not well-controlled or highly reproducible on live platforms. A more controlled and robust way would be to replace 02simple.t with:

First, 02simple-pp.t, a variant of it that always tests the PP code by setting the MATCH_SIMPLE_IMPLEMENTATION=PP env variable.

Second, 02simple-xs.t, a variant of it that clears that env variable, and throws a skip if the ::XS back-end is not available.

Let me know if it would be useful for me to hack something together as a PR.

@tobyink
Copy link
Owner

tobyink commented Jul 4, 2023

Yeah, I think that would be a worthwhile change.

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

2 participants