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

Support more regex engines for testing #112

Open
2 of 7 tasks
Aloso opened this issue Nov 26, 2024 · 2 comments
Open
2 of 7 tasks

Support more regex engines for testing #112

Aloso opened this issue Nov 26, 2024 · 2 comments
Labels
C-tests Related to unit testing capabilities enhancement New feature or request

Comments

@Aloso
Copy link
Member

Aloso commented Nov 26, 2024

Is your feature request related to a problem? Please describe.

Currently, tests can only be executed with PCRE2. They should be executable with a regex engine for every flavor. Also, the --test <ENGINE> CLI interface is confusing.

Describe the solution you'd like

Extend the supported engines to include at least the following:

  • pcre2
  • rust
  • onig
  • python
  • node
  • deno
  • java

Getting C# to work cross-platform is more tricky, which is why it isn't included in this list for now.

Strategies

  • Rust, Oniguruma: Regex engine is statically linked in the executable
  • Python: python3 -c ...; fallback to python executable if unavailable
  • Node: node -e ...
  • Deno: deno eval ...
  • Java: java with a temporary class file

Batch checking

A command that tests all pomsky expressions in a directory would be immensely helpful, e.g. for pre-commit hooks and CI. It should

  • walk the provided directory recursively, respecting .gitignore and .pomskyignore files
  • follow symlinks ??
  • compile and test all files with a .pomsky extension
  • if not using a statically linked regex library, re-use the process that does the testing for all files (similarly to regex-test)
  • provide a summary (number of succeeded/failed tests) and errors
@Aloso Aloso added the enhancement New feature or request label Nov 26, 2024
@fundef1
Copy link

fundef1 commented Nov 27, 2024

any chance for RE2 support? (go and DuckDB for instance).
I'm using pomsky to generate regexes (w/o the features RE2 lacks) so testing with PCRE is equivalent but having this checked off during tests would be nice.

@Aloso Aloso mentioned this issue Nov 27, 2024
@Aloso Aloso added the C-tests Related to unit testing capabilities label Nov 30, 2024
@Aloso Aloso added this to the v0.12 milestone Nov 30, 2024
@Aloso
Copy link
Member Author

Aloso commented Dec 12, 2024

Rust is now supported.

@Aloso Aloso removed this from the v0.12 milestone Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tests Related to unit testing capabilities enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants