diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-10-06 17:28:42 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-10-06 17:28:42 +0000 |
commit | 98a04818c6e15a1eab45c5224e6db3429496536e (patch) | |
tree | 35d28ed086837c67022617b1e58b3ed3b301d6c8 /testdata | |
parent | ef48210c5e60226937e07a00915f72f45cd9bacb (diff) | |
download | pcre2-98a04818c6e15a1eab45c5224e6db3429496536e.tar.gz |
Work on the tests for JIT.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@97 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/testinput14 | 85 | ||||
-rw-r--r-- | testdata/testinput15 | 88 | ||||
-rw-r--r-- | testdata/testinput16 | 168 | ||||
-rw-r--r-- | testdata/testinput17 | 86 | ||||
-rw-r--r-- | testdata/testinput18 | 17 | ||||
-rw-r--r-- | testdata/testinput2 | 79 | ||||
-rw-r--r-- | testdata/testoutput14 | 196 | ||||
-rw-r--r-- | testdata/testoutput15 | 163 | ||||
-rw-r--r-- | testdata/testoutput16 | 292 | ||||
-rw-r--r-- | testdata/testoutput17 | 134 | ||||
-rw-r--r-- | testdata/testoutput18 | 20 | ||||
-rw-r--r-- | testdata/testoutput2 | 191 |
12 files changed, 764 insertions, 755 deletions
diff --git a/testdata/testinput14 b/testdata/testinput14 index f6731f8..d882b61 100644 --- a/testdata/testinput14 +++ b/testdata/testinput14 @@ -1,9 +1,84 @@ -# This test is run only when JIT support is not available. It checks that an -# attempt to use it has the expected behaviour. It also tests things that -# are different without JIT. +# These are tests of the match-limiting features. The results are different for +# interpretive or JIT matching, so this test should not be run with JIT. The +# same tests are run using JIT in test 16. -/abc/I,jit,jitverify +/(a+)*zz/I + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits + aaaaaaaaaaaaaz\=find_limits -/a*/I +!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I + /* this is a C style comment */\=find_limits + +/^(?>a)++/ + aa\=find_limits + aaaaaaaaa\=find_limits + +/(a)(?1)++/ + aa\=find_limits + aaaaaaaaa\=find_limits + +/a(?:.)*?a/ims + abbbbbbbbbbbbbbbbbbbbba\=find_limits + +/a(?:.(*THEN))*?a/ims + abbbbbbbbbbbbbbbbbbbbba\=find_limits + +/a(?:.(*THEN:ABC))*?a/ims + abbbbbbbbbbbbbbbbbbbbba\=find_limits + +/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ + aabbccddee\=find_limits + +/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ + aabbccddee\=find_limits + +/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ + aabbccddee\=find_limits + +/(*LIMIT_MATCH=12bc)abc/ + +/(*LIMIT_MATCH=4294967290)abc/ + +/(*LIMIT_RECURSION=4294967280)abc/I + +/(a+)*zz/ + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\=match_limit=3000 + +/(a+)*zz/ + aaaaaaaaaaaaaz\=recursion_limit=10 + +/(*LIMIT_MATCH=3000)(a+)*zz/I + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\=match_limit=60000 + +/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I + aaaaaaaaaaaaaz + +/(*LIMIT_MATCH=60000)(a+)*zz/I + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\=match_limit=3000 + +/(*LIMIT_RECURSION=10)(a+)*zz/I + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\=recursion_limit=1000 + +/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I + aaaaaaaaaaaaaz + +/(*LIMIT_RECURSION=1000)(a+)*zz/I + aaaaaaaaaaaaaz + aaaaaaaaaaaaaz\=recursion_limit=10 + +# These three have infinitely nested recursions. + +/((?2))((?1))/ + abc + +/((?(R2)a+|(?1)b))/ + aaaabcde + +/(?(R)a*(?1)|((?R))b)/ + aaaabcde # End of testinput14 diff --git a/testdata/testinput15 b/testdata/testinput15 index 47bbb11..f6731f8 100644 --- a/testdata/testinput15 +++ b/testdata/testinput15 @@ -1,87 +1,9 @@ -# This test is run only when JIT support is available. It checks for a -# successful and an unsuccessful JIT compile, and a couple of things that are -# different with JIT. +# This test is run only when JIT support is not available. It checks that an +# attempt to use it has the expected behaviour. It also tests things that +# are different without JIT. -/abc/I,jit - -/(?(?C1)(?=a)a)/I,jit - -/(?(?C1)(?=a)a)/I +/abc/I,jit,jitverify /a*/I -/(?(R)a*(?1)|((?R))b)/jit - aaaabcde - -# Test various compile modes - -#pattern jit,jitverify - -/abcd/ - abcd - xyz - -/abcd/ - abcd - ab\=ps - ab\=ph - xyz - -/abcd/ - abcd - ab\=ps - ab\=ph - xyz - -/abcd/jit=1 - abcd - ab\=ps - ab\=ph - xyz - xyz\=ps - -/abcd/jit=2 - abcd - ab\=ps - ab\=ph - xyz - -/abcd/jit=3 - abcd - ab\=ps - ab\=ph - xyz - -/abcd/jit=4 - abcd - ab\=ps - ab\=ph - xyz - -/abcd/jit=5 - abcd - ab\=ps - ab\=ph - xyz - -/abcd/jit=6 - abcd - ab\=ps - ab\=ph - xyz - -/abcd/jit=7 - abcd - ab\=ps - ab\=ph - xyz - -/abcd/I,jit=2 - -/(*NO_START_OPT)a(*:m)b/mark - a - -/^12345678abcd/m - 12345678abcd - -# End of testinput15 +# End of testinput14 diff --git a/testdata/testinput16 b/testdata/testinput16 index 7240158..47bbb11 100644 --- a/testdata/testinput16 +++ b/testdata/testinput16 @@ -1,81 +1,87 @@ -# This set of tests is run only with the 8-bit library. It tests the POSIX -# interface, which is supported only with the 8-bit library. This test should -# not be run with JIT (which is not available for the POSIX interface). - -#forbid_utf -#pattern posix - -/abc/ - abc - *** Failers - -/^abc|def/ - abcdef - abcdef\=notbol - -/.*((abc)$|(def))/ - defabc - defabc\=noteol - -/the quick brown fox/ - the quick brown fox - *** Failers - The Quick Brown Fox - -/the quick brown fox/i - the quick brown fox - The Quick Brown Fox - -/abc.def/ - *** Failers - abc\ndef - -/abc$/ - abc - abc\n - -/(abc)\2/ - -/(abc\1)/ - abc - -/a*(b+)(z)(z)/ - aaaabbbbzzzz - aaaabbbbzzzz\=ovector=0 - aaaabbbbzzzz\=ovector=1 - aaaabbbbzzzz\=ovector=2 - -/ab.cd/ - ab-cd - ab=cd - ** Failers - ab\ncd - -/ab.cd/s - ab-cd - ab=cd - ab\ncd - -/a(b)c/no_auto_capture - abc - -/a(?P<name>b)c/no_auto_capture - abc - -/a?|b?/ - abc - ** Failers - ddd\=notempty - -/\w+A/ - CDAAAAB - -/\w+A/ungreedy - CDAAAAB - -/\Biss\B/I,aftertext - Mississippi - -/abc/\ - -# End of testdata/testinput16 +# This test is run only when JIT support is available. It checks for a +# successful and an unsuccessful JIT compile, and a couple of things that are +# different with JIT. + +/abc/I,jit + +/(?(?C1)(?=a)a)/I,jit + +/(?(?C1)(?=a)a)/I + +/a*/I + +/(?(R)a*(?1)|((?R))b)/jit + aaaabcde + +# Test various compile modes + +#pattern jit,jitverify + +/abcd/ + abcd + xyz + +/abcd/ + abcd + ab\=ps + ab\=ph + xyz + +/abcd/ + abcd + ab\=ps + ab\=ph + xyz + +/abcd/jit=1 + abcd + ab\=ps + ab\=ph + xyz + xyz\=ps + +/abcd/jit=2 + abcd + ab\=ps + ab\=ph + xyz + +/abcd/jit=3 + abcd + ab\=ps + ab\=ph + xyz + +/abcd/jit=4 + abcd + ab\=ps + ab\=ph + xyz + +/abcd/jit=5 + abcd + ab\=ps + ab\=ph + xyz + +/abcd/jit=6 + abcd + ab\=ps + ab\=ph + xyz + +/abcd/jit=7 + abcd + ab\=ps + ab\=ph + xyz + +/abcd/I,jit=2 + +/(*NO_START_OPT)a(*:m)b/mark + a + +/^12345678abcd/m + 12345678abcd + +# End of testinput15 diff --git a/testdata/testinput17 b/testdata/testinput17 index a517905..7240158 100644 --- a/testdata/testinput17 +++ b/testdata/testinput17 @@ -1,17 +1,81 @@ # This set of tests is run only with the 8-bit library. It tests the POSIX -# interface with UTF/UCP support, which is supported only with the 8-bit -# library. This test should not be run with JIT (which is not available for the -# POSIX interface). +# interface, which is supported only with the 8-bit library. This test should +# not be run with JIT (which is not available for the POSIX interface). +#forbid_utf #pattern posix -/a\x{1234}b/utf - a\x{1234}b +/abc/ + abc + *** Failers -/\w/ - +++\x{c2} +/^abc|def/ + abcdef + abcdef\=notbol -/\w/ucp - +++\x{c2} - -# End of testdata/testinput17 +/.*((abc)$|(def))/ + defabc + defabc\=noteol + +/the quick brown fox/ + the quick brown fox + *** Failers + The Quick Brown Fox + +/the quick brown fox/i + the quick brown fox + The Quick Brown Fox + +/abc.def/ + *** Failers + abc\ndef + +/abc$/ + abc + abc\n + +/(abc)\2/ + +/(abc\1)/ + abc + +/a*(b+)(z)(z)/ + aaaabbbbzzzz + aaaabbbbzzzz\=ovector=0 + aaaabbbbzzzz\=ovector=1 + aaaabbbbzzzz\=ovector=2 + +/ab.cd/ + ab-cd + ab=cd + ** Failers + ab\ncd + +/ab.cd/s + ab-cd + ab=cd + ab\ncd + +/a(b)c/no_auto_capture + abc + +/a(?P<name>b)c/no_auto_capture + abc + +/a?|b?/ + abc + ** Failers + ddd\=notempty + +/\w+A/ + CDAAAAB + +/\w+A/ungreedy + CDAAAAB + +/\Biss\B/I,aftertext + Mississippi + +/abc/\ + +# End of testdata/testinput16 diff --git a/testdata/testinput18 b/testdata/testinput18 new file mode 100644 index 0000000..a517905 --- /dev/null +++ b/testdata/testinput18 @@ -0,0 +1,17 @@ +# This set of tests is run only with the 8-bit library. It tests the POSIX +# interface with UTF/UCP support, which is supported only with the 8-bit +# library. This test should not be run with JIT (which is not available for the +# POSIX interface). + +#pattern posix + +/a\x{1234}b/utf + a\x{1234}b + +/\w/ + +++\x{c2} + +/\w/ucp + +++\x{c2} + +# End of testdata/testinput17 diff --git a/testdata/testinput2 b/testdata/testinput2 index 24f82c6..fa12400 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -1220,10 +1220,6 @@ /(a)(?P<named>bc)/IB,no_auto_capture -/(a+)*zz/I - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits - aaaaaaaaaaaaaz\=find_limits - /(aaa(?C1)bbb|ab)/I aaabbb aaabbb\=callout_data=0 @@ -1584,9 +1580,6 @@ a random value. /Ix abc\rdef abc\r\ndef -!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I - /* this is a C style comment */\=find_limits - /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I /()()()()()()()()()()()()()()()()()()()() @@ -3274,14 +3267,6 @@ a random value. /Ix /(abc)(?1)/I -/^(?>a)++/ - aa\=find_limits - aaaaaaaaa\=find_limits - -/(a)(?1)++/ - aa\=find_limits - aaaaaaaaa\=find_limits - /(?:(foo)|(bar)|(baz))X/allcaptures bazfooX foobazbarX @@ -3317,15 +3302,6 @@ a random value. /Ix /[:a[:abc]b:]/B -/((?2))((?1))/ - abc - -/((?(R2)a+|(?1)b))/ - aaaabcde - -/(?(R)a*(?1)|((?R))b)/ - aaaabcde - /(a+|(?R)b)/ /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout @@ -3357,15 +3333,6 @@ a random value. /Ix /z(*ACCEPT)a/I,aftertext baxzbx -/a(?:.)*?a/ims - abbbbbbbbbbbbbbbbbbbbba\=find_limits - -/a(?:.(*THEN))*?a/ims - abbbbbbbbbbbbbbbbbbbbba\=find_limits - -/a(?:.(*THEN:ABC))*?a/ims - abbbbbbbbbbbbbbbbbbbbba\=find_limits - /^(?>a+)(?>(z+))\w/B aaaazzzzb ** Failers @@ -3384,15 +3351,6 @@ a random value. /Ix /(a\1z)/B -/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ - aabbccddee\=find_limits - -/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ - aabbccddee\=find_limits - -/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ - aabbccddee\=find_limits - /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames aAz *** Failers @@ -3741,43 +3699,6 @@ a random value. /Ix /(?=b(*THEN)a|)bn|bnn/ bnn -# --------------------- - -/(*LIMIT_MATCH=12bc)abc/ - -/(*LIMIT_MATCH=4294967290)abc/ - -/(*LIMIT_RECURSION=4294967280)abc/I - -/(a+)*zz/ - aaaaaaaaaaaaaz - aaaaaaaaaaaaaz\=match_limit=3000 - -/(a+)*zz/ - aaaaaaaaaaaaaz\=recursion_limit=10 - -/(*LIMIT_MATCH=3000)(a+)*zz/I - aaaaaaaaaaaaaz - aaaaaaaaaaaaaz\=match_limit=60000 - -/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I - aaaaaaaaaaaaaz - -/(*LIMIT_MATCH=60000)(a+)*zz/I - aaaaaaaaaaaaaz - aaaaaaaaaaaaaz\=match_limit=3000 - -/(*LIMIT_RECURSION=10)(a+)*zz/I - aaaaaaaaaaaaaz - aaaaaaaaaaaaaz\=recursion_limit=1000 - -/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I - aaaaaaaaaaaaaz - -/(*LIMIT_RECURSION=1000)(a+)*zz/I - aaaaaaaaaaaaaz - aaaaaaaaaaaaaz\=recursion_limit=10 - # This test causes a segfault with Perl 5.18.0 /^(?=(a)){0}b(?1)/ diff --git a/testdata/testoutput14 b/testdata/testoutput14 index 7fa1588..c75f4ec 100644 --- a/testdata/testoutput14 +++ b/testdata/testoutput14 @@ -1,17 +1,195 @@ -# This test is run only when JIT support is not available. It checks that an -# attempt to use it has the expected behaviour. It also tests things that -# are different without JIT. +# These are tests of the match-limiting features. The results are different for +# interpretive or JIT matching, so this test should not be run with JIT. The +# same tests are run using JIT in test 16. -/abc/I,jit,jitverify +/(a+)*zz/I +Capturing subpattern count = 1 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits +Minimum match limit = 8 +Minimum recursion limit = 6 + 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz + 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaz\=find_limits +Minimum match limit = 32768 +Minimum recursion limit = 29 +No match + +!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I +Capturing subpattern count = 1 +May match empty string +Subject length lower bound = 0 + /* this is a C style comment */\=find_limits +Minimum match limit = 120 +Minimum recursion limit = 6 + 0: /* this is a C style comment */ + 1: /* this is a C style comment */ + +/^(?>a)++/ + aa\=find_limits +Minimum match limit = 5 +Minimum recursion limit = 2 + 0: aa + aaaaaaaaa\=find_limits +Minimum match limit = 12 +Minimum recursion limit = 2 + 0: aaaaaaaaa + +/(a)(?1)++/ + aa\=find_limits +Minimum match limit = 7 +Minimum recursion limit = 4 + 0: aa + 1: a + aaaaaaaaa\=find_limits +Minimum match limit = 21 +Minimum recursion limit = 4 + 0: aaaaaaaaa + 1: a + +/a(?:.)*?a/ims + abbbbbbbbbbbbbbbbbbbbba\=find_limits +Minimum match limit = 65 +Minimum recursion limit = 2 + 0: abbbbbbbbbbbbbbbbbbbbba + +/a(?:.(*THEN))*?a/ims + abbbbbbbbbbbbbbbbbbbbba\=find_limits +Minimum match limit = 86 +Minimum recursion limit = 45 + 0: abbbbbbbbbbbbbbbbbbbbba + +/a(?:.(*THEN:ABC))*?a/ims + abbbbbbbbbbbbbbbbbbbbba\=find_limits +Minimum match limit = 86 +Minimum recursion limit = 45 + 0: abbbbbbbbbbbbbbbbbbbbba + +/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ + aabbccddee\=find_limits +Minimum match limit = 7 +Minimum recursion limit = 2 + 0: aabbccddee + +/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ + aabbccddee\=find_limits +Minimum match limit = 17 +Minimum recursion limit = 16 + 0: aabbccddee + 1: aa + 2: bb + 3: cc + 4: dd + 5: ee + +/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ + aabbccddee\=find_limits +Minimum match limit = 13 +Minimum recursion limit = 10 + 0: aabbccddee + 1: aa + 2: cc + 3: ee + +/(*LIMIT_MATCH=12bc)abc/ +Failed: error 160 at offset 0: (*VERB) not recognized or malformed + +/(*LIMIT_MATCH=4294967290)abc/ +Failed: error 160 at offset 0: (*VERB) not recognized or malformed + +/(*LIMIT_RECURSION=4294967280)abc/I Capturing subpattern count = 0 +Recursion limit = 4294967280 First code unit = 'a' Last code unit = 'c' Subject length lower bound = 3 -JIT support is not available in this version of PCRE2 -/a*/I -Capturing subpattern count = 0 -May match empty string -Subject length lower bound = 0 +/(a+)*zz/ + aaaaaaaaaaaaaz +No match + aaaaaaaaaaaaaz\=match_limit=3000 +Failed: error -45: match limit exceeded + +/(a+)*zz/ + aaaaaaaaaaaaaz\=recursion_limit=10 +Failed: error -50: recursion limit exceeded + +/(*LIMIT_MATCH=3000)(a+)*zz/I +Capturing subpattern count = 1 +Match limit = 3000 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaz +Failed: error -45: match limit exceeded + aaaaaaaaaaaaaz\=match_limit=60000 +Failed: error -45: match limit exceeded + +/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I +Capturing subpattern count = 1 +Match limit = 3000 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaz +Failed: error -45: match limit exceeded + +/(*LIMIT_MATCH=60000)(a+)*zz/I +Capturing subpattern count = 1 +Match limit = 60000 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaz +No match + aaaaaaaaaaaaaz\=match_limit=3000 +Failed: error -45: match limit exceeded + +/(*LIMIT_RECURSION=10)(a+)*zz/I +Capturing subpattern count = 1 +Recursion limit = 10 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaz +Failed: error -50: recursion limit exceeded + aaaaaaaaaaaaaz\=recursion_limit=1000 +Failed: error -50: recursion limit exceeded + +/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I +Capturing subpattern count = 1 +Recursion limit = 1000 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaz +No match + +/(*LIMIT_RECURSION=1000)(a+)*zz/I +Capturing subpattern count = 1 +Recursion limit = 1000 +Starting code units: a z +Last code unit = 'z' +Subject length lower bound = 2 + aaaaaaaaaaaaaz +No match + aaaaaaaaaaaaaz\=recursion_limit=10 +Failed: error -50: recursion limit exceeded + +# These three have infinitely nested recursions. + +/((?2))((?1))/ + abc +Failed: error -49: nested recursion at the same subject position + +/((?(R2)a+|(?1)b))/ + aaaabcde +Failed: error -49: nested recursion at the same subject position + +/(?(R)a*(?1)|((?R))b)/ + aaaabcde +Failed: error -49: nested recursion at the same subject position # End of testinput14 diff --git a/testdata/testoutput15 b/testdata/testoutput15 index 630ae04..7fa1588 100644 --- a/testdata/testoutput15 +++ b/testdata/testoutput15 @@ -1,164 +1,17 @@ -# This test is run only when JIT support is available. It checks for a -# successful and an unsuccessful JIT compile, and a couple of things that are -# different with JIT. +# This test is run only when JIT support is not available. It checks that an +# attempt to use it has the expected behaviour. It also tests things that +# are different without JIT. -/abc/I,jit +/abc/I,jit,jitverify Capturing subpattern count = 0 -No options First code unit = 'a' -Need char = 'c' +Last code unit = 'c' Subject length lower bound = 3 -No starting char list -JIT study was successful - -/(?(?C1)(?=a)a)/I,jit -Capturing subpattern count = 0 -May match empty string -No options -No first code unit -No last code unit -Study returned NULL -JIT study was not successful - -/(?(?C1)(?=a)a)/I -Capturing subpattern count = 0 -May match empty string -No options -No first code unit -No last code unit -Subject length lower bound = -1 -No starting char list -JIT study was not successful +JIT support is not available in this version of PCRE2 /a*/I Capturing subpattern count = 0 May match empty string -No options -No first code unit -No last code unit -Study returned NULL - -/(?(R)a*(?1)|((?R))b)/S+ - aaaabcde -Error -27 (JIT stack limit reached) - -# Test various compile modes - -#pattern jit,jitverify - -/abcd/ - abcd - 0: abcd (JIT) - xyz -No match (JIT) - -/abcd/ - abcd - 0: abcd (JIT) - ab\P -Partial match: ab (JIT) - ab\P\P -Partial match: ab (JIT) - xyz -No match (JIT) - -/abcd/ - abcd - 0: abcd (JIT) - ab\P -Partial match: ab (JIT) - ab\P\P -Partial match: ab (JIT) - xyz -No match (JIT) - -/abcd/jit=1 - abcd - 0: abcd (JIT) - ab\P -Partial match: ab - ab\P\P -Partial match: ab - xyz -No match (JIT) - xyz\P -No match - -/abcd/jit=2 - abcd - 0: abcd - ab\P -Partial match: ab (JIT) - ab\P\P -Partial match: ab - xyz -No match - -/abcd/jit=3 - abcd - 0: abcd (JIT) - ab\P -Partial match: ab (JIT) - ab\P\P -Partial match: ab - xyz -No match (JIT) - -/abcd/jit=4 - abcd - 0: abcd - ab\P -Partial match: ab - ab\P\P -Partial match: ab (JIT) - xyz -No match - -/abcd/jit=5 - abcd - 0: abcd (JIT) - ab\P -Partial match: ab - ab\P\P -Partial match: ab (JIT) - xyz -No match (JIT) - -/abcd/jit=6 - abcd - 0: abcd - ab\P -Partial match: ab (JIT) - ab\P\P -Partial match: ab (JIT) - xyz -No match - -/abcd/jit=7 - abcd - 0: abcd (JIT) - ab\P -Partial match: ab (JIT) - ab\P\P -Partial match: ab (JIT) - xyz -No match (JIT) - -/abcd/I,jit=2 -Capturing subpattern count = 0 -No options -First code unit = 'a' -Last code unit = 'd' -Subject length lower bound = 4 -No starting char list -JIT study was successful - -/(*NO_START_OPT)a(*:m)b/mark - a -No match, mark = m (JIT) - -/^12345678abcd/m - 12345678abcd - 0: 12345678abcd (JIT) +Subject length lower bound = 0 -# End of testinput15 +# End of testinput14 diff --git a/testdata/testoutput16 b/testdata/testoutput16 index 1a3de59..630ae04 100644 --- a/testdata/testoutput16 +++ b/testdata/testoutput16 @@ -1,128 +1,164 @@ -# This set of tests is run only with the 8-bit library. It tests the POSIX -# interface, which is supported only with the 8-bit library. This test should -# not be run with JIT (which is not available for the POSIX interface). - -#forbid_utf -#pattern posix - -/abc/ - abc - 0: abc - *** Failers -No match: POSIX code 17: match failed - -/^abc|def/ - abcdef - 0: abc - abcdef\=notbol - 0: def - -/.*((abc)$|(def))/ - defabc - 0: defabc - 1: abc - 2: abc - defabc\=noteol - 0: def - 1: def - 3: def - -/the quick brown fox/ - the quick brown fox - 0: the quick brown fox - *** Failers -No match: POSIX code 17: match failed - The Quick Brown Fox -No match: POSIX code 17: match failed - -/the quick brown fox/i - the quick brown fox - 0: the quick brown fox - The Quick Brown Fox - 0: The Quick Brown Fox - -/abc.def/ - *** Failers -No match: POSIX code 17: match failed - abc\ndef -No match: POSIX code 17: match failed - -/abc$/ - abc - 0: abc - abc\n - 0: abc - -/(abc)\2/ -Failed: POSIX code 15: bad back reference at offset 7 - -/(abc\1)/ - abc -No match: POSIX code 17: match failed - -/a*(b+)(z)(z)/ - aaaabbbbzzzz - 0: aaaabbbbzz - 1: bbbb - 2: z - 3: z - aaaabbbbzzzz\=ovector=0 -Matched without capture - aaaabbbbzzzz\=ovector=1 - 0: aaaabbbbzz - aaaabbbbzzzz\=ovector=2 - 0: aaaabbbbzz - 1: bbbb - -/ab.cd/ - ab-cd - 0: ab-cd - ab=cd - 0: ab=cd - ** Failers -No match: POSIX code 17: match failed - ab\ncd -No match: POSIX code 17: match failed - -/ab.cd/s - ab-cd - 0: ab-cd - ab=cd - 0: ab=cd - ab\ncd - 0: ab\x0acd - -/a(b)c/no_auto_capture - abc -Matched with REG_NOSUB - -/a(?P<name>b)c/no_auto_capture - abc -Matched with REG_NOSUB - -/a?|b?/ - abc - 0: a - ** Failers - 0: - ddd\=notempty -No match: POSIX code 17: match failed - -/\w+A/ - CDAAAAB - 0: CDAAAA - -/\w+A/ungreedy - CDAAAAB - 0: CDA - -/\Biss\B/I,aftertext -** Ignored with POSIX interface: info - Mississippi - 0: iss - 0+ issippi - -/abc/\ -Failed: POSIX code 9: bad escape sequence at offset 4 - -# End of testdata/testinput16 +# This test is run only when JIT support is available. It checks for a +# successful and an unsuccessful JIT compile, and a couple of things that are +# different with JIT. + +/abc/I,jit +Capturing subpattern count = 0 +No options +First code unit = 'a' +Need char = 'c' +Subject length lower bound = 3 +No starting char list +JIT study was successful + +/(?(?C1)(?=a)a)/I,jit +Capturing subpattern count = 0 +May match empty string +No options +No first code unit +No last code unit +Study returned NULL +JIT study was not successful + +/(?(?C1)(?=a)a)/I +Capturing subpattern count = 0 +May match empty string +No options +No first code unit +No last code unit +Subject length lower bound = -1 +No starting char list +JIT study was not successful + +/a*/I +Capturing subpattern count = 0 +May match empty string +No options +No first code unit +No last code unit +Study returned NULL + +/(?(R)a*(?1)|((?R))b)/S+ + aaaabcde +Error -27 (JIT stack limit reached) + +# Test various compile modes + +#pattern jit,jitverify + +/abcd/ + abcd + 0: abcd (JIT) + xyz +No match (JIT) + +/abcd/ + abcd + 0: abcd (JIT) + ab\P +Partial match: ab (JIT) + ab\P\P +Partial match: ab (JIT) + xyz +No match (JIT) + +/abcd/ + abcd + 0: abcd (JIT) + ab\P +Partial match: ab (JIT) + ab\P\P +Partial match: ab (JIT) + xyz +No match (JIT) + +/abcd/jit=1 + abcd + 0: abcd (JIT) + ab\P +Partial match: ab + ab\P\P +Partial match: ab + xyz +No match (JIT) + xyz\P +No match + +/abcd/jit=2 + abcd + 0: abcd + ab\P +Partial match: ab (JIT) + ab\P\P +Partial match: ab + xyz +No match + +/abcd/jit=3 + abcd + 0: abcd (JIT) + ab\P +Partial match: ab (JIT) + ab\P\P +Partial match: ab + xyz +No match (JIT) + +/abcd/jit=4 + abcd + 0: abcd + ab\P +Partial match: ab + ab\P\P +Partial match: ab (JIT) + xyz +No match + +/abcd/jit=5 + abcd + 0: abcd (JIT) + ab\P +Partial match: ab + ab\P\P +Partial match: ab (JIT) + xyz +No match (JIT) + +/abcd/jit=6 + abcd + 0: abcd + ab\P +Partial match: ab (JIT) + ab\P\P +Partial match: ab (JIT) + xyz +No match + +/abcd/jit=7 + abcd + 0: abcd (JIT) + ab\P +Partial match: ab (JIT) + ab\P\P +Partial match: ab (JIT) + xyz +No match (JIT) + +/abcd/I,jit=2 +Capturing subpattern count = 0 +No options +First code unit = 'a' +Last code unit = 'd' +Subject length lower bound = 4 +No starting char list +JIT study was successful + +/(*NO_START_OPT)a(*:m)b/mark + a +No match, mark = m (JIT) + +/^12345678abcd/m + 12345678abcd + 0: 12345678abcd (JIT) + +# End of testinput15 diff --git a/testdata/testoutput17 b/testdata/testoutput17 index 954b4b5..1a3de59 100644 --- a/testdata/testoutput17 +++ b/testdata/testoutput17 @@ -1,20 +1,128 @@ # This set of tests is run only with the 8-bit library. It tests the POSIX -# interface with UTF/UCP support, which is supported only with the 8-bit -# library. This test should not be run with JIT (which is not available for the -# POSIX interface). +# interface, which is supported only with the 8-bit library. This test should +# not be run with JIT (which is not available for the POSIX interface). +#forbid_utf #pattern posix -/a\x{1234}b/utf - a\x{1234}b - 0: a\x{1234}b +/abc/ + abc + 0: abc + *** Failers +No match: POSIX code 17: match failed + +/^abc|def/ + abcdef + 0: abc + abcdef\=notbol + 0: def -/\w/ - +++\x{c2} +/.*((abc)$|(def))/ + defabc + 0: defabc + 1: abc + 2: abc + defabc\=noteol + 0: def + 1: def + 3: def + +/the quick brown fox/ + the quick brown fox + 0: the quick brown fox + *** Failers +No match: POSIX code 17: match failed + The Quick Brown Fox No match: POSIX code 17: match failed -/\w/ucp - +++\x{c2} - 0: \xc2 - -# End of testdata/testinput17 +/the quick brown fox/i + the quick brown fox + 0: the quick brown fox + The Quick Brown Fox + 0: The Quick Brown Fox + +/abc.def/ + *** Failers +No match: POSIX code 17: match failed + abc\ndef +No match: POSIX code 17: match failed + +/abc$/ + abc + 0: abc + abc\n + 0: abc + +/(abc)\2/ +Failed: POSIX code 15: bad back reference at offset 7 + +/(abc\1)/ + abc +No match: POSIX code 17: match failed + +/a*(b+)(z)(z)/ + aaaabbbbzzzz + 0: aaaabbbbzz + 1: bbbb + 2: z + 3: z + aaaabbbbzzzz\=ovector=0 +Matched without capture + aaaabbbbzzzz\=ovector=1 + 0: aaaabbbbzz + aaaabbbbzzzz\=ovector=2 + 0: aaaabbbbzz + 1: bbbb + +/ab.cd/ + ab-cd + 0: ab-cd + ab=cd + 0: ab=cd + ** Failers +No match: POSIX code 17: match failed + ab\ncd +No match: POSIX code 17: match failed + +/ab.cd/s + ab-cd + 0: ab-cd + ab=cd + 0: ab=cd + ab\ncd + 0: ab\x0acd + +/a(b)c/no_auto_capture + abc +Matched with REG_NOSUB + +/a(?P<name>b)c/no_auto_capture + abc +Matched with REG_NOSUB + +/a?|b?/ + abc + 0: a + ** Failers + 0: + ddd\=notempty +No match: POSIX code 17: match failed + +/\w+A/ + CDAAAAB + 0: CDAAAA + +/\w+A/ungreedy + CDAAAAB + 0: CDA + +/\Biss\B/I,aftertext +** Ignored with POSIX interface: info + Mississippi + 0: iss + 0+ issippi + +/abc/\ +Failed: POSIX code 9: bad escape sequence at offset 4 + +# End of testdata/testinput16 diff --git a/testdata/testoutput18 b/testdata/testoutput18 new file mode 100644 index 0000000..954b4b5 --- /dev/null +++ b/testdata/testoutput18 @@ -0,0 +1,20 @@ +# This set of tests is run only with the 8-bit library. It tests the POSIX +# interface with UTF/UCP support, which is supported only with the 8-bit +# library. This test should not be run with JIT (which is not available for the +# POSIX interface). + +#pattern posix + +/a\x{1234}b/utf + a\x{1234}b + 0: a\x{1234}b + +/\w/ + +++\x{c2} +No match: POSIX code 17: match failed + +/\w/ucp + +++\x{c2} + 0: \xc2 + +# End of testdata/testinput17 diff --git a/testdata/testoutput2 b/testdata/testoutput2 index 690139c..2da7604 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -4303,21 +4303,6 @@ First code unit = 'a' Last code unit = 'c' Subject length lower bound = 3 -/(a+)*zz/I -Capturing subpattern count = 1 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits -Minimum match limit = 8 -Minimum recursion limit = 6 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz - 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - aaaaaaaaaaaaaz\=find_limits -Minimum match limit = 32768 -Minimum recursion limit = 29 -No match - /(aaa(?C1)bbb|ab)/I Capturing subpattern count = 1 First code unit = 'a' @@ -6143,16 +6128,6 @@ Subject length lower bound = 5 1: \x0d 2: \x0a -!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I -Capturing subpattern count = 1 -May match empty string -Subject length lower bound = 0 - /* this is a C style comment */\=find_limits -Minimum match limit = 120 -Minimum recursion limit = 6 - 0: /* this is a C style comment */ - 1: /* this is a C style comment */ - /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I Capturing subpattern count = 1 Named capturing subpatterns: @@ -10876,28 +10851,6 @@ First code unit = 'a' Last code unit = 'c' Subject length lower bound = 6 -/^(?>a)++/ - aa\=find_limits -Minimum match limit = 5 -Minimum recursion limit = 2 - 0: aa - aaaaaaaaa\=find_limits -Minimum match limit = 12 -Minimum recursion limit = 2 - 0: aaaaaaaaa - -/(a)(?1)++/ - aa\=find_limits -Minimum match limit = 7 -Minimum recursion limit = 4 - 0: aa - 1: a - aaaaaaaaa\=find_limits -Minimum match limit = 21 -Minimum recursion limit = 4 - 0: aaaaaaaaa - 1: a - /(?:(foo)|(bar)|(baz))X/allcaptures bazfooX 0: fooX @@ -10931,7 +10884,6 @@ Matched, but too many substrings Matched, but too many substrings 0: fooX bazfooX\=ovector=2 -Matched, but too many substrings 0: fooX 1: foo bazfooX\=ovector=3 @@ -11097,18 +11049,6 @@ Matched, but too many substrings End ------------------------------------------------------------------ -/((?2))((?1))/ - abc -Failed: error -49: nested recursion at the same subject position - -/((?(R2)a+|(?1)b))/ - aaaabcde -Failed: error -49: nested recursion at the same subject position - -/(?(R)a*(?1)|((?R))b)/ - aaaabcde -Failed: error -49: nested recursion at the same subject position - /(a+|(?R)b)/ Failed: error 140 at offset 7: recursion could loop indefinitely @@ -11227,24 +11167,6 @@ Subject length lower bound = 0 0: z 0+ bx -/a(?:.)*?a/ims - abbbbbbbbbbbbbbbbbbbbba\=find_limits -Minimum match limit = 65 -Minimum recursion limit = 2 - 0: abbbbbbbbbbbbbbbbbbbbba - -/a(?:.(*THEN))*?a/ims - abbbbbbbbbbbbbbbbbbbbba\=find_limits -Minimum match limit = 86 -Minimum recursion limit = 45 - 0: abbbbbbbbbbbbbbbbbbbbba - -/a(?:.(*THEN:ABC))*?a/ims - abbbbbbbbbbbbbbbbbbbbba\=find_limits -Minimum match limit = 86 -Minimum recursion limit = 45 - 0: abbbbbbbbbbbbbbbbbbbbba - /^(?>a+)(?>(z+))\w/B ------------------------------------------------------------------ Bra @@ -11311,32 +11233,6 @@ No match End ------------------------------------------------------------------ -/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ - aabbccddee\=find_limits -Minimum match limit = 7 -Minimum recursion limit = 2 - 0: aabbccddee - -/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ - aabbccddee\=find_limits -Minimum match limit = 17 -Minimum recursion limit = 16 - 0: aabbccddee - 1: aa - 2: bb - 3: cc - 4: dd - 5: ee - -/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ - aabbccddee\=find_limits -Minimum match limit = 13 -Minimum recursion limit = 10 - 0: aabbccddee - 1: aa - 2: cc - 3: ee - /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames aAz 0: aAz @@ -12080,93 +11976,6 @@ No match bnn 0: bn -# --------------------- - -/(*LIMIT_MATCH=12bc)abc/ -Failed: error 160 at offset 0: (*VERB) not recognized or malformed - -/(*LIMIT_MATCH=4294967290)abc/ -Failed: error 160 at offset 0: (*VERB) not recognized or malformed - -/(*LIMIT_RECURSION=4294967280)abc/I -Capturing subpattern count = 0 -Recursion limit = 4294967280 -First code unit = 'a' -Last code unit = 'c' -Subject length lower bound = 3 - -/(a+)*zz/ - aaaaaaaaaaaaaz -No match - aaaaaaaaaaaaaz\=match_limit=3000 -Failed: error -45: match limit exceeded - -/(a+)*zz/ - aaaaaaaaaaaaaz\=recursion_limit=10 -Failed: error -50: recursion limit exceeded - -/(*LIMIT_MATCH=3000)(a+)*zz/I -Capturing subpattern count = 1 -Match limit = 3000 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaz -Failed: error -45: match limit exceeded - aaaaaaaaaaaaaz\=match_limit=60000 -Failed: error -45: match limit exceeded - -/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I -Capturing subpattern count = 1 -Match limit = 3000 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaz -Failed: error -45: match limit exceeded - -/(*LIMIT_MATCH=60000)(a+)*zz/I -Capturing subpattern count = 1 -Match limit = 60000 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaz -No match - aaaaaaaaaaaaaz\=match_limit=3000 -Failed: error -45: match limit exceeded - -/(*LIMIT_RECURSION=10)(a+)*zz/I -Capturing subpattern count = 1 -Recursion limit = 10 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaz -Failed: error -50: recursion limit exceeded - aaaaaaaaaaaaaz\=recursion_limit=1000 -Failed: error -50: recursion limit exceeded - -/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I -Capturing subpattern count = 1 -Recursion limit = 1000 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaz -No match - -/(*LIMIT_RECURSION=1000)(a+)*zz/I -Capturing subpattern count = 1 -Recursion limit = 1000 -Starting code units: a z -Last code unit = 'z' -Subject length lower bound = 2 - aaaaaaaaaaaaaz -No match - aaaaaaaaaaaaaz\=recursion_limit=10 -Failed: error -50: recursion limit exceeded - # This test causes a segfault with Perl 5.18.0 /^(?=(a)){0}b(?1)/ |