/[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 771 by ph10, Tue Nov 29 15:34:12 2011 UTC revision 835 by ph10, Wed Dec 28 16:10:09 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. --/
   
     NOTE: This is a non-UTF-8 set of tests. When UTF-8 is needed, use test  
     5, and if Unicode Property Support is needed, use test 13. --/  
7    
8  /-- 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
9      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 3325  a random value. /Ix Line 3322  a random value. /Ix
3322  /A(*PRUNE)B|A(*PRUNE)C/K  /A(*PRUNE)B|A(*PRUNE)C/K
3323      AC      AC
3324    
3325    /--- A whole lot of tests of verbs with arguments are here rather than in test
3326         11 because Perl doesn't seem to follow its specification entirely
3327         correctly. ---/
3328    
3329    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
3330         not clear how Perl defines "involved in the failure of the match". ---/
3331    
3332    /^(A(*THEN:A)B|C(*THEN:B)D)/K
3333        AB
3334        CD
3335        ** Failers
3336        AC
3337        CB
3338    
3339    /--- Check the use of names for success and failure. PCRE doesn't show these
3340    names for success, though Perl does, contrary to its spec. ---/
3341    
3342    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
3343        AB
3344        CD
3345        ** Failers
3346        AC
3347        CB
3348    
3349    /--- An empty name does not pass back an empty string. It is the same as if no
3350    name were given. ---/
3351    
3352    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
3353        AB
3354        CD
3355    
3356    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
3357    
3358    /A(*PRUNE:A)B/K
3359        ACAB
3360    
3361    /(*MARK:A)(*PRUNE:B)(C|X)/KS
3362        C
3363        D
3364    
3365    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
3366        C
3367        D
3368    
3369    /(*MARK:A)(*THEN:B)(C|X)/KS
3370        C
3371        D
3372    
3373    /(*MARK:A)(*THEN:B)(C|X)/KSY
3374        C
3375        D
3376    
3377    /(*MARK:A)(*THEN:B)(C|X)/KSS
3378        C
3379        D
3380    
3381    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
3382    
3383    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
3384        AAAC
3385    
3386    /--- Same --/
3387    
3388    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
3389        AAAC
3390    
3391  /--- 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
3392       PRUNE kills it. Perl behaves differently. ---/       PRUNE kills it. ---/
3393    
3394  /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK  /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3395      AAAC      AAAC
3396    
3397  /--- Mark names can be duplicated. Perl doesn't give a mark for this one,  /A(*:A)A+(*SKIP)(B|Z) | AC/xK
3398  though PCRE does. ---/      AAAC
3399    
3400    /--- This should fail, as a null name is the same as no name ---/
3401    
3402    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
3403        AAAC
3404    
3405    /--- This fails in PCRE, and I think that is in accordance with Perl's
3406         documentation, though in Perl it succeeds. ---/
3407    
3408    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
3409        AAAC
3410    
3411    /--- Mark names can be duplicated ---/
3412    
3413    /A(*:A)B|X(*:A)Y/K
3414        AABC
3415        XXYZ
3416    
3417  /^A(*:A)B|^X(*:A)Y/K  /^A(*:A)B|^X(*:A)Y/K
3418      ** Failers      ** Failers
3419      XAQQ      XAQQ
3420    
3421    /--- A check on what happens after hitting a mark and them bumping along to
3422    something that does not even start. Perl reports tags after the failures here,
3423    though it does not when the individual letters are made into something
3424    more complicated. ---/
3425    
3426    /A(*:A)B|XX(*:B)Y/K
3427        AABC
3428        XXYZ
3429        ** Failers
3430        XAQQ
3431        XAQQXZZ
3432        AXQQQ
3433        AXXQQQ
3434    
3435  /--- 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
3436  optimizations defeat this. So does the PCRE optimization unless we disable it  optimizations defeat this. So does the PCRE optimization unless we disable it
3437  with \Y. ---/  with \Y. ---/
# Line 3347  with \Y. ---/ Line 3441  with \Y. ---/
3441      ** Failers      ** Failers
3442      DEFGABC\Y      DEFGABC\Y
3443    
3444    /--- Repeat some tests with added studying. ---/
3445    
3446    /A(*COMMIT)B/+KS
3447        ACABX
3448    
3449    /A(*THEN)B|A(*THEN)C/KS
3450        AC
3451    
3452    /A(*PRUNE)B|A(*PRUNE)C/KS
3453        AC
3454    
3455    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
3456        AB
3457        CD
3458        ** Failers
3459        AC
3460        CB
3461    
3462    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
3463        AB
3464        CD
3465        ** Failers
3466        AC
3467        CB
3468    
3469    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
3470        AB
3471        CD
3472    
3473    /A(*PRUNE:A)B/KS
3474        ACAB
3475    
3476    /(*MARK:A)(*PRUNE:B)(C|X)/KS
3477        C
3478        D
3479    
3480    /(*MARK:A)(*THEN:B)(C|X)/KS
3481        C
3482        D
3483    
3484    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
3485        AAAC
3486    
3487    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
3488        AAAC
3489    
3490    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
3491        AAAC
3492    
3493    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
3494        AAAC
3495    
3496    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
3497        AAAC
3498    
3499    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
3500        AAAC
3501    
3502    /A(*:A)B|XX(*:B)Y/KS
3503        AABC
3504        XXYZ
3505        ** Failers
3506        XAQQ
3507        XAQQXZZ
3508        AXQQQ
3509        AXXQQQ
3510    
3511    /(*COMMIT)ABC/
3512        ABCDEFG
3513        ** Failers
3514        DEFGABC\Y
3515    
3516  /^(ab (c+(*THEN)cd) | xyz)/x  /^(ab (c+(*THEN)cd) | xyz)/x
3517      abcccd      abcccd
3518    
# Line 3814  AbcdCBefgBhiBqz Line 3980  AbcdCBefgBhiBqz
3980  /^a\x1z/<JS>  /^a\x1z/<JS>
3981      ax1z      ax1z
3982    
3983    /^a\X41z/<JS>
3984        aX41z
3985        *** Failers
3986        aAz
3987    
3988  /^a\u0041z/<JS>  /^a\u0041z/<JS>
3989      aAz      aAz
3990      *** Failers      *** Failers
# Line 3836  AbcdCBefgBhiBqz Line 4007  AbcdCBefgBhiBqz
4007    
4008  /(?(?=c)c|d)*+Y/BZ  /(?(?=c)c|d)*+Y/BZ
4009    
4010  /a[\NB]c/  /(?<=ab\Cde)X/8
     aNc  
   
 /a[B-\Nc]/  
   
 /(a)(?2){0,1999}?(b)/  
   
 /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/  
   
 /--- This test, with something more complicated than individual letters, causes  
 different behaviour in Perl. Perhaps it disables some optimization; no tag is  
 passed back for the failures, whereas in PCRE there is a tag. ---/  
   
 /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK  
     AABC  
     XXYZ  
     ** Failers  
     XAQQ  
     XAQQXZZ  
     AXQQQ  
     AXXQQQ  
   
 /-- Perl doesn't give marks for these, though it does if the alternatives are  
 replaced by single letters. --/  
   
 /(b|q)(*:m)f|a(*:n)w/K  
     aw  
     ** Failers  
     abc  
   
 /(q|b)(*:m)f|a(*:n)w/K  
     aw  
     ** Failers  
     abc  
   
 /-- After a partial match, the behaviour is as for a failure. --/  
   
 /^a(*:X)bcde/K  
    abc\P  
4011    
4012  /-- End of testinput2 --/  /-- End of testinput2 --/

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

  ViewVC Help
Powered by ViewVC 1.1.5