diff options
Diffstat (limited to 'ext/pcre/pcrelib/testdata')
-rw-r--r-- | ext/pcre/pcrelib/testdata/testinput1 | 14 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testinput2 | 65 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testinput5 | 3 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testinput6 | 10 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testinput7 | 18 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testoutput1 | 21 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testoutput2 | 211 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testoutput5 | 4 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testoutput6 | 16 | ||||
-rw-r--r-- | ext/pcre/pcrelib/testdata/testoutput7 | 26 |
10 files changed, 355 insertions, 33 deletions
diff --git a/ext/pcre/pcrelib/testdata/testinput1 b/ext/pcre/pcrelib/testdata/testinput1 index 6cacbb512..d999d2948 100644 --- a/ext/pcre/pcrelib/testdata/testinput1 +++ b/ext/pcre/pcrelib/testdata/testinput1 @@ -2332,15 +2332,14 @@ baz foobarbaz -/The case of aaaaaa is missed out below because I think Perl 5.005_02 gets/ -/it wrong; it sets $1 to aaa rather than aa. Compare the following test,/ -/where it does set $1 to aa when matching aaaaaa./ +/The cases of aaaa and aaaaaa are missed out below because Perl does things/ +/differently. We know that odd, and maybe incorrect, things happen with/ +/recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./ /^(a\1?){4}$/ a aa aaa - aaaa aaaaa aaaaaaa aaaaaaaa @@ -4067,4 +4066,11 @@ /^%((?(?=[a])[^%])|b)*%$/ %ab% +/(?i)a(?-i)b|c/ + XabX + XAbX + CcC + ** Failers + XABX + /-- End of testinput1 --/ diff --git a/ext/pcre/pcrelib/testdata/testinput2 b/ext/pcre/pcrelib/testdata/testinput2 index 3319bb732..94a18c9a4 100644 --- a/ext/pcre/pcrelib/testdata/testinput2 +++ b/ext/pcre/pcrelib/testdata/testinput2 @@ -344,10 +344,25 @@ *** Failers a -/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I +/This one is here because Perl behaves differently; see also the following/I /^(a\1?){4}$/I + aaaa aaaaaa + +/Perl does not fail these two for the final subjects. Neither did PCRE until/ +/release 8.01. The problem is in backtracking into a subpattern that contains/ +/a recursive reference to itself. PCRE has now made these into atomic patterns./ + +/^(xa|=?\1a){2}$/ + xa=xaa + ** Failers + xa=xaaa + +/^(xa|=?\1a)+$/ + xa=xaa + ** Failers + xa=xaaa /These are syntax tests from Perl 5.005/I @@ -3169,4 +3184,52 @@ a random value. /Ix /(\3)(\1)(a)/SI cat +/i(?(DEFINE)(?<s>a))/SI + i + +/()i(?(1)a)/SI + ia + +/(?i)a(?-i)b|c/BZ + XabX + XAbX + CcC + ** Failers + XABX + +/(?i)a(?s)b|c/BZ + +/(?i)a(?s-i)b|c/BZ + +/^(ab(c\1)d|x){2}$/BZ + xabcxd + +/^(?&t)*+(?(DEFINE)(?<t>.))$/BZ + +/^(?&t)*(?(DEFINE)(?<t>.))$/BZ + +/ -- The first four of these are not in the Perl 5.10 test because Perl + documents that the use of \K in assertions is "not well defined". The + last is here because Perl gives the match as "b" rather than "ab". I + believe this to be a Perl bug. --/ + +/(?=a\Kb)ab/ + ab + +/(?!a\Kb)ac/ + ac + +/^abc(?<=b\Kc)d/ + abcd + +/^abc(?<!b\Kq)d/ + abcd + +/(?>a\Kb)z|(ab)/ + ab + +/----------------------/ + +/(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/ + /-- End of testinput2 --/ diff --git a/ext/pcre/pcrelib/testdata/testinput5 b/ext/pcre/pcrelib/testdata/testinput5 index 82818d7dc..68795e609 100644 --- a/ext/pcre/pcrelib/testdata/testinput5 +++ b/ext/pcre/pcrelib/testdata/testinput5 @@ -742,4 +742,7 @@ can't tell the difference.) --/ xxxxabcde\P xxxxabcde\P\P +/X\W{3}X/8 + \PX + /-- End of testinput5 --/ diff --git a/ext/pcre/pcrelib/testdata/testinput6 b/ext/pcre/pcrelib/testdata/testinput6 index f4249da81..759018a3a 100644 --- a/ext/pcre/pcrelib/testdata/testinput6 +++ b/ext/pcre/pcrelib/testdata/testinput6 @@ -370,13 +370,6 @@ \x{3b1} \x{ff5a} -/^\X/8 - A - A\x{300}BC - A\x{300}\x{301}\x{302}BC - *** Failers - \x{300} - /^[\X]/8 X123 *** Failers @@ -756,4 +749,7 @@ /[\p{Lu}\x20]+/ \x41\x20\x50\xC2\x54\xC9\x20\x54\x4F\x44\x41\x59 +/\p{Avestan}\p{Bamum}\p{Egyptian_Hieroglyphs}\p{Imperial_Aramaic}\p{Inscriptional_Pahlavi}\p{Inscriptional_Parthian}\p{Javanese}\p{Kaithi}\p{Lisu}\p{Meetei_Mayek}\p{Old_South_Arabian}\p{Old_Turkic}\p{Samaritan}\p{Tai_Tham}\p{Tai_Viet}/8 + \x{10b00}\x{a6ef}\x{13007}\x{10857}\x{10b78}\x{10b58}\x{a980}\x{110c1}\x{a4ff}\x{abc0}\x{10a7d}\x{10c48}\x{0800}\x{1aad}\x{aac0} + /-- End of testinput6 --/ diff --git a/ext/pcre/pcrelib/testdata/testinput7 b/ext/pcre/pcrelib/testdata/testinput7 index 710d9ee9b..5d2731192 100644 --- a/ext/pcre/pcrelib/testdata/testinput7 +++ b/ext/pcre/pcrelib/testdata/testinput7 @@ -4542,4 +4542,22 @@ CAD BAD +/^(?!a(*SKIP)b)/ + ac + +/^(?=a(*SKIP)b|ac)/ + ** Failers + ac + +/^(?=a(*THEN)b|ac)/ + ac + +/^(?=a(*PRUNE)b)/ + ab + ** Failers + ac + +/^(?(?!a(*SKIP)b))/ + ac + /-- End of testinput7 --/ diff --git a/ext/pcre/pcrelib/testdata/testoutput1 b/ext/pcre/pcrelib/testdata/testoutput1 index a2a6dd4e2..2fd033cc3 100644 --- a/ext/pcre/pcrelib/testdata/testoutput1 +++ b/ext/pcre/pcrelib/testdata/testoutput1 @@ -3752,10 +3752,10 @@ No match foobarbaz No match -/The case of aaaaaa is missed out below because I think Perl 5.005_02 gets/ -/it wrong; it sets $1 to aaa rather than aa. Compare the following test,/ +/The cases of aaaa and aaaaaa are missed out below because Perl does things/ +/differently. We know that odd, and maybe incorrect, things happen with/ No match -/where it does set $1 to aa when matching aaaaaa./ +/recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./ No match /^(a\1?){4}$/ @@ -3765,9 +3765,6 @@ No match No match aaa No match - aaaa - 0: aaaa - 1: a aaaaa 0: aaaaa 1: a @@ -6649,4 +6646,16 @@ No match 0: %ab% 1: +/(?i)a(?-i)b|c/ + XabX + 0: ab + XAbX + 0: Ab + CcC + 0: c + ** Failers +No match + XABX +No match + /-- End of testinput1 --/ diff --git a/ext/pcre/pcrelib/testdata/testoutput2 b/ext/pcre/pcrelib/testdata/testoutput2 index 30ea63b9c..c29bd5fd3 100644 --- a/ext/pcre/pcrelib/testdata/testoutput2 +++ b/ext/pcre/pcrelib/testdata/testoutput2 @@ -857,7 +857,7 @@ No match a No match -/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I +/This one is here because Perl behaves differently; see also the following/I Capturing subpattern count = 0 No options First char = 'T' @@ -869,9 +869,34 @@ Max back reference = 1 Options: anchored No first char No need char + aaaa +No match aaaaaa - 0: aaaaaa - 1: aa +No match + +/Perl does not fail these two for the final subjects. Neither did PCRE until/ +/release 8.01. The problem is in backtracking into a subpattern that contains/ +No match +/a recursive reference to itself. PCRE has now made these into atomic patterns./ +No match + +/^(xa|=?\1a){2}$/ + xa=xaa + 0: xa=xaa + 1: =xaa + ** Failers +No match + xa=xaaa +No match + +/^(xa|=?\1a)+$/ + xa=xaa + 0: xa=xaa + 1: =xaa + ** Failers +No match + xa=xaaa +No match /These are syntax tests from Perl 5.005/I Capturing subpattern count = 0 @@ -10463,4 +10488,184 @@ No set of starting bytes cat No match +/i(?(DEFINE)(?<s>a))/SI +Capturing subpattern count = 1 +Named capturing subpatterns: + s 1 +No options +First char = 'i' +No need char +Subject length lower bound = 1 +No set of starting bytes + i + 0: i + +/()i(?(1)a)/SI +Capturing subpattern count = 1 +No options +No first char +Need char = 'i' +Subject length lower bound = 1 +Starting byte set: i + ia + 0: ia + 1: + +/(?i)a(?-i)b|c/BZ +------------------------------------------------------------------ + Bra + NC a + 00 Opt + b + Alt + 00 Opt + c + Ket + End +------------------------------------------------------------------ + XabX + 0: ab + XAbX + 0: Ab + CcC + 0: c + ** Failers +No match + XABX +No match + +/(?i)a(?s)b|c/BZ +------------------------------------------------------------------ + Bra + NC a + 05 Opt + NC b + Alt + 05 Opt + NC c + Ket + End +------------------------------------------------------------------ + +/(?i)a(?s-i)b|c/BZ +------------------------------------------------------------------ + Bra + NC a + 04 Opt + b + Alt + 04 Opt + c + Ket + End +------------------------------------------------------------------ + +/^(ab(c\1)d|x){2}$/BZ +------------------------------------------------------------------ + Bra + ^ + Once + CBra 1 + ab + CBra 2 + c + \1 + Ket + d + Alt + x + Ket + Ket + Once + CBra 1 + ab + CBra 2 + c + \1 + Ket + d + Alt + x + Ket + Ket + $ + Ket + End +------------------------------------------------------------------ + xabcxd + 0: xabcxd + 1: abcxd + 2: cx + +/^(?&t)*+(?(DEFINE)(?<t>.))$/BZ +------------------------------------------------------------------ + Bra + ^ + Once + Brazero + Once + Recurse + KetRmax + Ket + Cond + Cond def + CBra 1 + Any + Ket + Ket + $ + Ket + End +------------------------------------------------------------------ + +/^(?&t)*(?(DEFINE)(?<t>.))$/BZ +------------------------------------------------------------------ + Bra + ^ + Brazero + Once + Recurse + KetRmax + Cond + Cond def + CBra 1 + Any + Ket + Ket + $ + Ket + End +------------------------------------------------------------------ + +/ -- The first four of these are not in the Perl 5.10 test because Perl + documents that the use of \K in assertions is "not well defined". The + last is here because Perl gives the match as "b" rather than "ab". I + believe this to be a Perl bug. --/ + +/(?=a\Kb)ab/ + ab + 0: b + +/(?!a\Kb)ac/ + ac + 0: ac + +/^abc(?<=b\Kc)d/ + abcd + 0: cd + +/^abc(?<!b\Kq)d/ + abcd + 0: abcd + +/(?>a\Kb)z|(ab)/ + ab + 0: ab + 1: ab + +/----------------------/ + +/(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/ +Failed: recursive call could loop indefinitely at offset 31 + /-- End of testinput2 --/ diff --git a/ext/pcre/pcrelib/testdata/testoutput5 b/ext/pcre/pcrelib/testdata/testoutput5 index f5de747ba..9d815ffa8 100644 --- a/ext/pcre/pcrelib/testdata/testoutput5 +++ b/ext/pcre/pcrelib/testdata/testoutput5 @@ -2072,4 +2072,8 @@ Partial match: abca xxxxabcde\P\P Partial match: abcde +/X\W{3}X/8 + \PX +Partial match: X + /-- End of testinput5 --/ diff --git a/ext/pcre/pcrelib/testdata/testoutput6 b/ext/pcre/pcrelib/testdata/testoutput6 index 4245d6a37..b4176eb57 100644 --- a/ext/pcre/pcrelib/testdata/testoutput6 +++ b/ext/pcre/pcrelib/testdata/testoutput6 @@ -618,18 +618,6 @@ No match \x{ff5a} 0: \x{ff5a} -/^\X/8 - A - 0: A - A\x{300}BC - 0: A\x{300} - A\x{300}\x{301}\x{302}BC - 0: A\x{300}\x{301}\x{302} - *** Failers - 0: * - \x{300} -No match - /^[\X]/8 X123 0: X @@ -1293,4 +1281,8 @@ No match \x41\x20\x50\xC2\x54\xC9\x20\x54\x4F\x44\x41\x59 0: A P\xc2T\xc9 TODAY +/\p{Avestan}\p{Bamum}\p{Egyptian_Hieroglyphs}\p{Imperial_Aramaic}\p{Inscriptional_Pahlavi}\p{Inscriptional_Parthian}\p{Javanese}\p{Kaithi}\p{Lisu}\p{Meetei_Mayek}\p{Old_South_Arabian}\p{Old_Turkic}\p{Samaritan}\p{Tai_Tham}\p{Tai_Viet}/8 + \x{10b00}\x{a6ef}\x{13007}\x{10857}\x{10b78}\x{10b58}\x{a980}\x{110c1}\x{a4ff}\x{abc0}\x{10a7d}\x{10c48}\x{0800}\x{1aad}\x{aac0} + 0: \x{10b00}\x{a6ef}\x{13007}\x{10857}\x{10b78}\x{10b58}\x{a980}\x{110c1}\x{a4ff}\x{abc0}\x{10a7d}\x{10c48}\x{800}\x{1aad}\x{aac0} + /-- End of testinput6 --/ diff --git a/ext/pcre/pcrelib/testdata/testoutput7 b/ext/pcre/pcrelib/testdata/testoutput7 index c6c9df46f..2aab80d74 100644 --- a/ext/pcre/pcrelib/testdata/testoutput7 +++ b/ext/pcre/pcrelib/testdata/testoutput7 @@ -7584,4 +7584,30 @@ No match BAD No match +/^(?!a(*SKIP)b)/ + ac +Error -16 + +/^(?=a(*SKIP)b|ac)/ + ** Failers +No match + ac +Error -16 + +/^(?=a(*THEN)b|ac)/ + ac +Error -16 + +/^(?=a(*PRUNE)b)/ + ab +Error -16 + ** Failers +No match + ac +Error -16 + +/^(?(?!a(*SKIP)b))/ + ac +Error -16 + /-- End of testinput7 --/ |