JSCRE needs to import the PCRE test suite We've now forked from PCRE... but we still need tests. We should import their test suite and write a tool to run JSCRE against the test data. It's only like 30 files and it should be rather straightforward to work up a tool to deal with them.
Created attachment 17726 [details] work in progress I'm making a JS parser that will work on unmodified PCRE test data files (only converted to UTF-8). I know that it's still buggy and skips some tests, but I wanted to upload this WIP test to give an early warning of RegExp regressions we seem to have in TOT :-(
I was separately pursuing a perl script that would convert PCRE test cases into files we could use directly in the LayoutTests directory. I have a half-baked version of that on my computer. Not sure if I should keep working on it.
Created attachment 17745 [details] proposed patch Many of the regressions in TOT are with character classes. E.g., "cthing".match(/^[]cde]/) is now null instead of ["c"].
Comment on attachment 17745 [details] proposed patch Looks great! What will we do with this going forward, though? For the many tests that reflect differences between PCRE and desired JavaScript behavior, will we change the original testinput/output files, or what? Some of the failures look to me like they might reflect problems in the test harness, like this one: +/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ + abcd\t\n\r\f\a\e9;\$\\?caxyz: FAIL. Actual results: "null" r=me
(In reply to comment #3) > Many of the regressions in TOT are with character classes. E.g., > "cthing".match(/^[]cde]/) is now null instead of ["c"]. That particular one is an intentional behavior change; the JavaScript specification and other web browsers require behavior different from PCRE's.
(In reply to comment #4) > What will we do with this going forward, though? > > For the many tests that reflect differences between PCRE and desired JavaScript > behavior, will we change the original testinput/output files, or what? I do not have a firm opinion either way. I envisioned this to work as a test for status quo and for crashes, that would be trivially upgradable to latest version from PCRE, but a clean test that says PASS and FAIL in correct places has a lot of value, too!
Committed revision 28513.