summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-03-22 17:23:09 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-03-22 17:23:09 +0000
commitdcc385a5c3dd9743e5dc63f99bb302be4cf51e80 (patch)
tree413577849eddfcf1b3c8789d74749d1e1ba5434d
parent712f2578028ec79534921d1b06f7b9d0fa1e643b (diff)
downloadpcre-dcc385a5c3dd9743e5dc63f99bb302be4cf51e80.tar.gz
Move some tests from testinput2 to testinput1 because they are now
Perl-compatible. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1299 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--testdata/testinput178
-rw-r--r--testdata/testinput2107
-rw-r--r--testdata/testoutput1107
-rw-r--r--testdata/testoutput2144
5 files changed, 199 insertions, 241 deletions
diff --git a/ChangeLog b/ChangeLog
index 15ce3ea..50c70f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,10 @@ Version 8.33 xx-xxxx-201x
(2) Previously, backtracking verbs were confined within assertions. This is
no longer the case, except for (*ACCEPT). Again, this sometimes improves
Perl compatibility, and sometimes does not.
+
+32. A number of tests that were in test 2 because Perl did things differently
+ have been moved to test 1, because either Perl or PCRE has changed, and
+ these tests are now compatible.
Version 8.32 30-November-2012
diff --git a/testdata/testinput1 b/testdata/testinput1
index b7b5934..4630e8d 100644
--- a/testdata/testinput1
+++ b/testdata/testinput1
@@ -5444,4 +5444,82 @@ backtracked onto, whether or not it has a label. --/
/(?>a(*COMMIT)c)d|abd/
abd
+/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
+ ac
+
+/-- These tests were formerly in test 2, but changes in PCRE and Perl have
+ made them compatible. --/
+
+/^(a)?(?(1)a|b)+$/
+ *** Failers
+ a
+
+/(?=a\Kb)ab/
+ ab
+
+/(?!a\Kb)ac/
+ ac
+
+/^abc(?<=b\Kc)d/
+ abcd
+
+/^abc(?<!b\Kq)d/
+ abcd
+
+
+/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
+ AAAC
+
+/^((abc|abcx)(*THEN)y|abcd)/
+ abcd
+ *** Failers
+ abcxy
+
+/^((yes|no)(*THEN)(*F))?/
+ yes
+
+/(A (.*) C? (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+
+/(A (.*) C? (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+
+/(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
+AbcdCBefgBhiBqz
+
+/(A (.*) C? (*THEN) | A D) \s* z/x
+AbcdCBefgBhiBqz
+
+/(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+
+/(A (.*) (?:C|) (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+
+/(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+
+/(A (.*) C{0,6} (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+
+/(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
+AbcdCEBefgBhiBqz
+
+/(A (.*) (CE){0,6} (*THEN) | A D) z/x
+AbcdCEBefgBhiBqz
+
+/(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+
+/(A (.*) (CE*){0,6} (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+
+/(?=a(*COMMIT)b|ac)ac|ac/
+ ac
+
+/(?=a(*COMMIT)b|(ac)) ac | (a)c/x
+ ac
+
+/--------/
+
/-- End of testinput1 --/
diff --git a/testdata/testinput2 b/testdata/testinput2
index 27e2d3c..91fcad8 100644
--- a/testdata/testinput2
+++ b/testdata/testinput2
@@ -313,12 +313,6 @@
*** Failers
fooabar
-/This one is here because Perl 5.005_02 doesn't fail it/I
-
-/^(a)?(?(1)a|b)+$/I
- *** Failers
- a
-
/This one is here because Perl behaves differently; see also the following/I
/^(a\1?){4}$/I
@@ -2939,7 +2933,7 @@ a random value. /Ix
xxxxabcde\P
xxxxabcde\P\P
-/-- This is not in the Perl >= 5.10 test because Perl seems currently to be
+/-- This is not in the Perl-compatible test because Perl seems currently to be
broken and not behaving as specified in that it *does* bumpalong after
hitting (*COMMIT). --/
@@ -2985,28 +2979,12 @@ a random value. /Ix
/^(?&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
+/ -- This one 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))/
/abc(*MARK:)pqr/
@@ -3021,7 +2999,7 @@ a random value. /Ix
/A(*COMMIT)B/+K
ACABX
-/--- These should be different, but in Perl 5.11 are not, which I think
+/--- These should be different, but in Perl they are not, which I think
is a bug in Perl. ---/
/A(*THEN)B|A(*THEN)C/K
@@ -3030,12 +3008,6 @@ a random value. /Ix
/A(*PRUNE)B|A(*PRUNE)C/K
AC
-/--- This should fail; the SKIP advances by one, but when we get to AC, the
- PRUNE kills it. Perl behaves differently. ---/
-
-/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
- AAAC
-
/--- Mark names can be duplicated. Perl doesn't give a mark for this one,
though PCRE does. ---/
@@ -3061,7 +3033,7 @@ with \Y. ---/
/^(ab (c+(*FAIL)cd) | xyz)/x
abcccd
-/--- Perl 5.11 gets some of these wrong ---/
+/--- Perl gets some of these wrong ---/
/(?>.(*ACCEPT))*?5/
abcde
@@ -3121,14 +3093,6 @@ with \Y. ---/
/X\H++\R/BZ
X\x0d\x0a
-/-- Perl treats this one differently, not failing the second string. I believe
- that is a bug in Perl. --/
-
-/^((abc|abcx)(*THEN)y|abcd)/
- abcd
- *** Failers
- abcxy
-
/(?<=abc)def/
abc\P\P
@@ -3453,52 +3417,6 @@ with \Y. ---/
/a(?:.(*THEN:ABC))*?a/ims
\Mabbbbbbbbbbbbbbbbbbbbba
-/-- These tests are in agreement with development Perl 5.015, which has fixed
- some things, but they don't all work with 5.012, so they aren't in the
- Perl-compatible tests. Those after the first come from Perl's own test
- files. --/
-
-/^((yes|no)(*THEN)(*F))?/
- yes
-
-/(A (.*) C? (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-
-/(A (.*) C? (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-
-/(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
-AbcdCBefgBhiBqz
-
-/(A (.*) C? (*THEN) | A D) \s* z/x
-AbcdCBefgBhiBqz
-
-/(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-
-/(A (.*) (?:C|) (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-
-/(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-
-/(A (.*) C{0,6} (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-
-/(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
-AbcdCEBefgBhiBqz
-
-/(A (.*) (CE){0,6} (*THEN) | A D) z/x
-AbcdCEBefgBhiBqz
-
-/(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-
-/(A (.*) (CE*){0,6} (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-
-/-----------------------------------------------/
-
/^(?>a+)(?>(z+))\w/BZ
aaaazzzzb
** Failers
@@ -3751,24 +3669,9 @@ replaced by single letters. --/
\r\r\r\P
\r\r\r\P\P
-/-- These two are here because Perl does not match: it seems to allow the
-COMMIT to escape from the assertion. --/
-
-/(?=a(*COMMIT)b|ac)ac|ac/
- ac
-
-/(?=a(*COMMIT)b|(ac)) ac | (a)c/x
- ac
-
"AB(C(D))(E(F))?(?(?=\2)(?=\4))"
ABCDGHI\O03
-/-- This one is here because Perl does not confine the *COMMIT to the
-assertion, and therefore fails the entire subroutine call. --/
-
-/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
- ac
-
/-- These are all run as real matches in test 1; here we are just checking the
settings of the anchored and startline bits. --/
@@ -3915,6 +3818,6 @@ backtracking verbs. --/
/^(A(*THEN)B|A(*THEN)D)/
AD
-/-- End of Perl diffences --/
+/-------------------------/
/-- End of testinput2 --/
diff --git a/testdata/testoutput1 b/testdata/testoutput1
index b38a876..28d186e 100644
--- a/testdata/testoutput1
+++ b/testdata/testoutput1
@@ -8973,4 +8973,111 @@ No match
abd
No match
+/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
+ ac
+ 0: ac
+ 1: <unset>
+ 2: c
+
+/-- These tests were formerly in test 2, but changes in PCRE and Perl have
+ made them compatible. --/
+
+/^(a)?(?(1)a|b)+$/
+ *** Failers
+No match
+ a
+No match
+
+/(?=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(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
+ AAAC
+No match, mark = A
+
+/^((abc|abcx)(*THEN)y|abcd)/
+ abcd
+ 0: abcd
+ 1: abcd
+ *** Failers
+No match
+ abcxy
+No match
+
+/^((yes|no)(*THEN)(*F))?/
+ yes
+No match
+
+/(A (.*) C? (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) C? (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) C? (*THEN) | A D) \s* z/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) (?:C|) (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) C{0,6} (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
+AbcdCEBefgBhiBqz
+No match
+
+/(A (.*) (CE){0,6} (*THEN) | A D) z/x
+AbcdCEBefgBhiBqz
+No match
+
+/(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
+AbcdCBefgBhiBqz
+No match
+
+/(A (.*) (CE*){0,6} (*THEN) | A D) z/x
+AbcdCBefgBhiBqz
+No match
+
+/(?=a(*COMMIT)b|ac)ac|ac/
+ ac
+No match
+
+/(?=a(*COMMIT)b|(ac)) ac | (a)c/x
+ ac
+No match
+
+/--------/
+
/-- End of testinput1 --/
diff --git a/testdata/testoutput2 b/testdata/testoutput2
index 1718b0e..d7fa221 100644
--- a/testdata/testoutput2
+++ b/testdata/testoutput2
@@ -824,22 +824,6 @@ No match
fooabar
No match
-/This one is here because Perl 5.005_02 doesn't fail it/I
-Capturing subpattern count = 0
-No options
-First char = 'T'
-Need char = 't'
-
-/^(a)?(?(1)a|b)+$/I
-Capturing subpattern count = 1
-Options: anchored
-No first char
-No need char
- *** Failers
-No match
- a
-No match
-
/This one is here because Perl behaves differently; see also the following/I
Capturing subpattern count = 0
No options
@@ -10357,7 +10341,7 @@ Partial match: abca
xxxxabcde\P\P
Partial match: abcde
-/-- This is not in the Perl >= 5.10 test because Perl seems currently to be
+/-- This is not in the Perl-compatible test because Perl seems currently to be
broken and not behaving as specified in that it *does* bumpalong after
hitting (*COMMIT). --/
@@ -10553,34 +10537,14 @@ No match
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
+/ -- This one 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
@@ -10600,7 +10564,7 @@ Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offse
ACABX
No match
-/--- These should be different, but in Perl 5.11 are not, which I think
+/--- These should be different, but in Perl they are not, which I think
is a bug in Perl. ---/
/A(*THEN)B|A(*THEN)C/K
@@ -10611,13 +10575,6 @@ No match
AC
No match
-/--- This should fail; the SKIP advances by one, but when we get to AC, the
- PRUNE kills it. Perl behaves differently. ---/
-
-/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
- AAAC
-No match, mark = A
-
/--- Mark names can be duplicated. Perl doesn't give a mark for this one,
though PCRE does. ---/
@@ -10651,7 +10608,7 @@ No match
abcccd
No match
-/--- Perl 5.11 gets some of these wrong ---/
+/--- Perl gets some of these wrong ---/
/(?>.(*ACCEPT))*?5/
abcde
@@ -10830,18 +10787,6 @@ No match
X\x0d\x0a
No match
-/-- Perl treats this one differently, not failing the second string. I believe
- that is a bug in Perl. --/
-
-/^((abc|abcx)(*THEN)y|abcd)/
- abcd
- 0: abcd
- 1: abcd
- *** Failers
-No match
- abcxy
-No match
-
/(?<=abc)def/
abc\P\P
Partial match at offset 3: abc
@@ -11765,65 +11710,6 @@ Minimum match() limit = 86
Minimum match() recursion limit = 45
0: abbbbbbbbbbbbbbbbbbbbba
-/-- These tests are in agreement with development Perl 5.015, which has fixed
- some things, but they don't all work with 5.012, so they aren't in the
- Perl-compatible tests. Those after the first come from Perl's own test
- files. --/
-
-/^((yes|no)(*THEN)(*F))?/
- yes
-No match
-
-/(A (.*) C? (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) C? (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) C? (*THEN) | A D) \s* z/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) (?:C|) (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) C{0,6} (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x
-AbcdCEBefgBhiBqz
-No match
-
-/(A (.*) (CE){0,6} (*THEN) | A D) z/x
-AbcdCEBefgBhiBqz
-No match
-
-/(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x
-AbcdCBefgBhiBqz
-No match
-
-/(A (.*) (CE*){0,6} (*THEN) | A D) z/x
-AbcdCBefgBhiBqz
-No match
-
-/-----------------------------------------------/
-
/^(?>a+)(?>(z+))\w/BZ
------------------------------------------------------------------
Bra
@@ -12340,31 +12226,11 @@ Partial match: \x0d\x0d
\r\r\r\P\P
0: \x0d\x0d
-/-- These two are here because Perl does not match: it seems to allow the
-COMMIT to escape from the assertion. --/
-
-/(?=a(*COMMIT)b|ac)ac|ac/
- ac
-No match
-
-/(?=a(*COMMIT)b|(ac)) ac | (a)c/x
- ac
-No match
-
"AB(C(D))(E(F))?(?(?=\2)(?=\4))"
ABCDGHI\O03
Matched, but too many substrings
0: ABCD
-/-- This one is here because Perl does not confine the *COMMIT to the
-assertion, and therefore fails the entire subroutine call. --/
-
-/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
- ac
- 0: ac
- 1: <unset>
- 2: c
-
/-- These are all run as real matches in test 1; here we are just checking the
settings of the anchored and startline bits. --/
@@ -12731,6 +12597,6 @@ No match
0: AD
1: AD
-/-- End of Perl diffences --/
+/-------------------------/
/-- End of testinput2 --/