-
Notifications
You must be signed in to change notification settings - Fork 12
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
Strategy for ensuring functional correctness? #13
Comments
My initial thoughts
|
As far as I know, and I know little, irregex, an implementation in Scheme, became the benchmark for browser RegExp with both Chrome and Firefox using it nowadays. Some random comments around the web even indicated that it's more standard in practice now than the specification itself, but not sure if that's actually the case. Perhaps a strategy could be to aim at compatibility with what the ES specification defines, and in case of doubt look at what irregex does? Hmm. Regarding testing, this makes me wonder if there may be tests somewhere in Chrome/FF one could run in addition. |
Thanks @dcodeIO - I was not aware of iiregex. |
Another possible solution could be fuzz testing which generate some valid regexps with different inputs and flags and compare result with the same parameters from JavaScript's RegExp. Probably this library great starting point: https://github.com/codenote/regex-fuzz/blob/master/main.py |
I'd consider this library to be a useable POC (proof of concept) in its current state. The implementation is based around the description of regex as provided by the MDN regex cheat sheet, however, this is not a detailed description of the regex language and in some places deviates from others see - #9
At this point it probably makes sense to consider a few points:
The text was updated successfully, but these errors were encountered: