PCRE2Project / pcre2

PCRE2 development is now based here.
Other
922 stars 194 forks source link

Add some test cases #253

Closed JetXujing closed 1 year ago

JetXujing commented 1 year ago

"Add tests which use recurse to test \K and Mark in atomic scope" is used to override two branches of the init_frame function, as follows: https://github.com/PCRE2Project/pcre2/blob/1bc34ffa64c33381d793fb5cdddf3f484e603d23/src/pcre2_jit_compile.c#L2188 https://github.com/PCRE2Project/pcre2/blob/1bc34ffa64c33381d793fb5cdddf3f484e603d23/src/pcre2_jit_compile.c#L2197

"Add the test which use firstline,utf,match_invalid_utf together" is used to overwrite a branch of do_utfreadnewline_invalid: https://github.com/PCRE2Project/pcre2/blob/1bc34ffa64c33381d793fb5cdddf3f484e603d23/src/pcre2_jit_compile.c#L4657

JetXujing commented 1 year ago

In fact, the test cases I added simply covered the corresponding branch, but didn't really test the functionality of the options. In fact, I don't have a good idea for these test cases.

Anyone with a good idea to optimize these test cases.

PhilipHazel commented 1 year ago

As this stands, the tests are not running. Looks like you updated the tests without updating the output?

PhilipHazel commented 1 year ago

I've merged these tests. Thanks for your contribution.