summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pcre/pcrelib/testdata')
-rw-r--r--ext/pcre/pcrelib/testdata/testinput114
-rw-r--r--ext/pcre/pcrelib/testdata/testinput237
-rw-r--r--ext/pcre/pcrelib/testdata/testinput53
-rw-r--r--ext/pcre/pcrelib/testdata/testinput718
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput121
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput2140
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput54
-rw-r--r--ext/pcre/pcrelib/testdata/testoutput726
8 files changed, 249 insertions, 14 deletions
diff --git a/ext/pcre/pcrelib/testdata/testinput1 b/ext/pcre/pcrelib/testdata/testinput1
index 6cacbb5124..d999d2948a 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 3319bb7327..1c1a72dd57 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,24 @@ 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
+
/-- End of testinput2 --/
diff --git a/ext/pcre/pcrelib/testdata/testinput5 b/ext/pcre/pcrelib/testdata/testinput5
index 82818d7dc1..68795e6095 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/testinput7 b/ext/pcre/pcrelib/testdata/testinput7
index 710d9ee9b6..5d27311927 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 a2a6dd4e22..2fd033cc3f 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 30ea63b9cc..4b27de0543 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,113 @@ 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
+
/-- End of testinput2 --/
diff --git a/ext/pcre/pcrelib/testdata/testoutput5 b/ext/pcre/pcrelib/testdata/testoutput5
index f5de747ba0..9d815ffa82 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/testoutput7 b/ext/pcre/pcrelib/testdata/testoutput7
index c6c9df46f5..2aab80d74b 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 --/