diff options
Diffstat (limited to 'testdata/testinput2')
-rw-r--r-- | testdata/testinput2 | 211 |
1 files changed, 209 insertions, 2 deletions
diff --git a/testdata/testinput2 b/testdata/testinput2 index 94a18c9..306f8d4 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -2279,8 +2279,6 @@ a random value. /Ix /a+b?(*THEN)c+(*FAIL)/C aaabccc -/a(*PRUNE:XXX)b/ - /a(*MARK)b/ /(?i:A{1,}\6666666666)/ @@ -3232,4 +3230,213 @@ a random value. /Ix /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/ +/abc(*MARK:)pqr/ + +/abc(*:)pqr/ + +/abc(*FAIL:123)xyz/ + +/--- This should, and does, fail. In Perl, it does not, which I think is a + bug because replacing the B in the pattern by (B|D) does make it fail. ---/ + +/A(*COMMIT)B/+K + ACABX + +/--- These should be different, but in Perl 5.11 are not, which I think + is a bug in Perl. ---/ + +/A(*THEN)B|A(*THEN)C/K + AC + +/A(*PRUNE)B|A(*PRUNE)C/K + AC + +/--- A whole lot of tests of verbs with arguments are here rather than in test + 11 because Perl doesn't seem to follow its specification entirely + correctly. ---/ + +/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is + not clear how Perl defines "involved in the failure of the match". ---/ + +/^(A(*THEN:A)B|C(*THEN:B)D)/K + AB + CD + ** Failers + AC + CB + +/--- Check the use of names for success and failure. PCRE doesn't show these +names for success, though Perl does, contrary to its spec. ---/ + +/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K + AB + CD + ** Failers + AC + CB + +/--- An empty name does not pass back an empty string. It is the same as if no +name were given. ---/ + +/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K + AB + CD + +/--- PRUNE goes to next bumpalong; COMMIT does not. ---/ + +/A(*PRUNE:A)B/K + ACAB + +/(*MARK:A)(*PRUNE:B)(C|X)/K + C + D + +/(*MARK:A)(*THEN:B)(C|X)/K + C + D + +/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/ + +/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK + AAAC + +/--- Same --/ + +/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK + AAAC + +/--- This should fail; the SKIP advances by one, but when we get to AC, the + PRUNE kills it. ---/ + +/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK + AAAC + +/A(*:A)A+(*SKIP)(B|Z) | AC/xK + AAAC + +/--- This should fail, as a null name is the same as no name ---/ + +/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK + AAAC + +/--- This fails in PCRE, and I think that is in accordance with Perl's + documentation, though in Perl it succeeds. ---/ + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK + AAAC + +/--- Mark names can be duplicated ---/ + +/A(*:A)B|X(*:A)Y/K + AABC + XXYZ + +/^A(*:A)B|^X(*:A)Y/K + ** Failers + XAQQ + +/--- A check on what happens after hitting a mark and them bumping along to +something that does not even start. Perl reports tags after the failures here, +though it does not when the individual letters are made into something +more complicated. ---/ + +/A(*:A)B|XX(*:B)Y/K + AABC + XXYZ + ** Failers + XAQQ + XAQQXZZ + AXQQQ + AXXQQQ + +/--- COMMIT at the start of a pattern should be the same as an anchor. Perl +optimizations defeat this. So does the PCRE optimization unless we disable it +with \Y. ---/ + +/(*COMMIT)ABC/ + ABCDEFG + ** Failers + DEFGABC\Y + +/--- Repeat some tests with added studying. ---/ + +/A(*COMMIT)B/+KS + ACABX + +/A(*THEN)B|A(*THEN)C/KS + AC + +/A(*PRUNE)B|A(*PRUNE)C/KS + AC + +/^(A(*THEN:A)B|C(*THEN:B)D)/KS + AB + CD + ** Failers + AC + CB + +/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS + AB + CD + ** Failers + AC + CB + +/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS + AB + CD + +/A(*PRUNE:A)B/KS + ACAB + +/(*MARK:A)(*PRUNE:B)(C|X)/KS + C + D + +/(*MARK:A)(*THEN:B)(C|X)/KS + C + D + +/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS + AAAC + +/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS + AAAC + +/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS + AAAC + +/A(*:A)A+(*SKIP)(B|Z) | AC/xKS + AAAC + +/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS + AAAC + +/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS + AAAC + +/A(*:A)B|XX(*:B)Y/KS + AABC + XXYZ + ** Failers + XAQQ + XAQQXZZ + AXQQQ + AXXQQQ + +/(*COMMIT)ABC/ + ABCDEFG + ** Failers + DEFGABC\Y + +/^(ab (c+(*THEN)cd) | xyz)/x + abcccd + +/^(ab (c+(*PRUNE)cd) | xyz)/x + abcccd + +/^(ab (c+(*FAIL)cd) | xyz)/x + abcccd + /-- End of testinput2 --/ |