/[pcre]/code/trunk/testdata/testinput2
ViewVC logotype

Diff of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 766 by ph10, Fri Nov 25 10:04:12 2011 UTC revision 771 by ph10, Tue Nov 29 15:34:12 2011 UTC
# Line 3325  a random value. /Ix Line 3325  a random value. /Ix
3325  /A(*PRUNE)B|A(*PRUNE)C/K  /A(*PRUNE)B|A(*PRUNE)C/K
3326      AC      AC
3327    
 /--- 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)/KS  
     C  
     D  
   
 /(*MARK:A)(*PRUNE:B)(C|X)/KSS  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KS  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KSY  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KSS  
     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  
   
3328  /--- This should fail; the SKIP advances by one, but when we get to AC, the  /--- This should fail; the SKIP advances by one, but when we get to AC, the
3329       PRUNE kills it. ---/       PRUNE kills it. Perl behaves differently. ---/
3330    
3331  /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK  /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3332      AAAC      AAAC
3333    
3334  /A(*:A)A+(*SKIP)(B|Z) | AC/xK  /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3335      AAAC  though PCRE does. ---/
   
 /--- 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  
3336    
 /--- Mark names can be duplicated ---/  
   
 /A(*:A)B|X(*:A)Y/K  
     AABC  
     XXYZ  
   
3337  /^A(*:A)B|^X(*:A)Y/K  /^A(*:A)B|^X(*:A)Y/K
3338      ** Failers      ** Failers
3339      XAQQ      XAQQ
3340    
 /--- 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  
   
3341  /--- COMMIT at the start of a pattern should be the same as an anchor. Perl  /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3342  optimizations defeat this. So does the PCRE optimization unless we disable it  optimizations defeat this. So does the PCRE optimization unless we disable it
3343  with \Y. ---/  with \Y. ---/
# Line 3444  with \Y. ---/ Line 3347  with \Y. ---/
3347      ** Failers      ** Failers
3348      DEFGABC\Y      DEFGABC\Y
3349    
 /--- 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  
   
3350  /^(ab (c+(*THEN)cd) | xyz)/x  /^(ab (c+(*THEN)cd) | xyz)/x
3351      abcccd      abcccd
3352    
# Line 4014  AbcdCBefgBhiBqz Line 3845  AbcdCBefgBhiBqz
3845    
3846  /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/  /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3847    
3848    /--- This test, with something more complicated than individual letters, causes
3849    different behaviour in Perl. Perhaps it disables some optimization; no tag is
3850    passed back for the failures, whereas in PCRE there is a tag. ---/
3851    
3852    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
3853        AABC
3854        XXYZ
3855        ** Failers
3856        XAQQ
3857        XAQQXZZ
3858        AXQQQ
3859        AXXQQQ
3860    
3861    /-- Perl doesn't give marks for these, though it does if the alternatives are
3862    replaced by single letters. --/
3863    
3864    /(b|q)(*:m)f|a(*:n)w/K
3865        aw
3866        ** Failers
3867        abc
3868    
3869    /(q|b)(*:m)f|a(*:n)w/K
3870        aw
3871        ** Failers
3872        abc
3873    
3874    /-- After a partial match, the behaviour is as for a failure. --/
3875    
3876    /^a(*:X)bcde/K
3877       abc\P
3878    
3879  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.766  
changed lines
  Added in v.771

  ViewVC Help
Powered by ViewVC 1.1.5