/[pcre]/code/branches/pcre16/testdata/testinput2
ViewVC logotype

Diff of /code/branches/pcre16/testdata/testinput2

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

revision 800 by ph10, Mon Nov 21 10:41:54 2011 UTC revision 801 by ph10, Mon Dec 12 16:23:37 2011 UTC
# Line 3  Line 3 
3      It also checks the non-Perl syntax the PCRE supports (Python, .NET,      It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4      Oniguruma). Finally, there are some tests where PCRE and Perl differ,      Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5      either because PCRE can't be compatible, or there is a possible Perl      either because PCRE can't be compatible, or there is a possible Perl
6      bug. --/      bug.
7    
8        NOTE: This is a non-UTF-8 set of tests. When UTF-8 is needed, use test
9        5, and if Unicode Property Support is needed, use test 13. --/
10    
11  /-- Originally, the Perl >= 5.10 things were in here too, but now I have  /-- Originally, the Perl >= 5.10 things were in here too, but now I have
12      separated many (most?) of them out into test 11. However, there may still      separated many (most?) of them out into test 11. However, there may still
# Line 3322  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  
   
 /--- Mark names can be duplicated ---/  
3336    
 /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 3441  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 3980  AbcdCBefgBhiBqz Line 3814  AbcdCBefgBhiBqz
3814  /^a\x1z/<JS>  /^a\x1z/<JS>
3815      ax1z      ax1z
3816    
 /^a\X41z/<JS>  
     aX41z  
     *** Failers  
     aAz  
   
3817  /^a\u0041z/<JS>  /^a\u0041z/<JS>
3818      aAz      aAz
3819      *** Failers      *** Failers
# Line 4007  AbcdCBefgBhiBqz Line 3836  AbcdCBefgBhiBqz
3836    
3837  /(?(?=c)c|d)*+Y/BZ  /(?(?=c)c|d)*+Y/BZ
3838    
3839  /(?<=ab\Cde)X/8  /a[\NB]c/
3840        aNc
3841    
3842    /a[B-\Nc]/
3843    
3844    /(a)(?2){0,1999}?(b)/
3845    
3846    /(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.800  
changed lines
  Added in v.801

  ViewVC Help
Powered by ViewVC 1.1.5