/[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 496 by ph10, Tue Mar 2 19:11:17 2010 UTC revision 511 by ph10, Mon Mar 29 09:25:38 2010 UTC
# Line 2279  a random value. /Ix Line 2279  a random value. /Ix
2279  /a+b?(*THEN)c+(*FAIL)/C  /a+b?(*THEN)c+(*FAIL)/C
2280      aaabccc      aaabccc
2281    
 /a(*PRUNE:XXX)b/  
   
2282  /a(*MARK)b/  /a(*MARK)b/
2283    
2284  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
# Line 3208  a random value. /Ix Line 3206  a random value. /Ix
3206    
3207  /^(?&t)*(?(DEFINE)(?<t>.))$/BZ  /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
3208    
3209    / -- The first four of these are not in the Perl 5.10 test because Perl
3210         documents that the use of \K in assertions is "not well defined". The
3211         last is here because Perl gives the match as "b" rather than "ab". I
3212         believe this to be a Perl bug. --/
3213    
3214    /(?=a\Kb)ab/
3215        ab
3216    
3217    /(?!a\Kb)ac/
3218        ac
3219    
3220    /^abc(?<=b\Kc)d/
3221        abcd
3222    
3223    /^abc(?<!b\Kq)d/
3224        abcd
3225    
3226    /(?>a\Kb)z|(ab)/
3227        ab
3228    
3229    /----------------------/
3230    
3231    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3232    
3233    /abc(*MARK:)pqr/
3234    
3235    /abc(*:)pqr/
3236    
3237    /abc(*FAIL:123)xyz/
3238    
3239    /--- This should, and does, fail. In Perl, it does not, which I think is a
3240         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3241    
3242    /A(*COMMIT)B/+K
3243        ACABX
3244    
3245    /--- These should be different, but in Perl 5.11 are not, which I think
3246         is a bug in Perl. ---/
3247    
3248    /A(*THEN)B|A(*THEN)C/K
3249        AC
3250    
3251    /A(*PRUNE)B|A(*PRUNE)C/K
3252        AC
3253    
3254    /--- A whole lot of tests of verbs with arguments are here rather than in test
3255         11 because Perl doesn't seem to follow its specification entirely
3256         correctly. ---/
3257    
3258    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
3259         not clear how Perl defines "involved in the failure of the match". ---/
3260    
3261    /^(A(*THEN:A)B|C(*THEN:B)D)/K
3262        AB
3263        CD
3264        ** Failers
3265        AC
3266        CB
3267    
3268    /--- Check the use of names for success and failure. PCRE doesn't show these
3269    names for success, though Perl does, contrary to its spec. ---/
3270    
3271    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
3272        AB
3273        CD
3274        ** Failers
3275        AC
3276        CB
3277    
3278    /--- An empty name does not pass back an empty string. It is the same as if no
3279    name were given. ---/
3280    
3281    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
3282        AB
3283        CD
3284    
3285    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
3286    
3287    /A(*PRUNE:A)B/K
3288        ACAB
3289    
3290    /(*MARK:A)(*PRUNE:B)(C|X)/K
3291        C
3292        D
3293    
3294    /(*MARK:A)(*THEN:B)(C|X)/K
3295        C
3296        D
3297    
3298    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
3299    
3300    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
3301        AAAC
3302    
3303    /--- Same --/
3304    
3305    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
3306        AAAC
3307    
3308    /--- This should fail; the SKIP advances by one, but when we get to AC, the
3309         PRUNE kills it. ---/
3310    
3311    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3312        AAAC
3313    
3314    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
3315        AAAC
3316    
3317    /--- This should fail, as a null name is the same as no name ---/
3318    
3319    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
3320        AAAC
3321    
3322    /--- This fails in PCRE, and I think that is in accordance with Perl's
3323         documentation, though in Perl it succeeds. ---/
3324    
3325    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
3326        AAAC
3327    
3328    /--- Mark names can be duplicated ---/
3329    
3330    /A(*:A)B|X(*:A)Y/K
3331        AABC
3332        XXYZ
3333    
3334    /^A(*:A)B|^X(*:A)Y/K
3335        ** Failers
3336        XAQQ
3337    
3338    /--- A check on what happens after hitting a mark and them bumping along to
3339    something that does not even start. Perl reports tags after the failures here,
3340    though it does not when the individual letters are made into something
3341    more complicated. ---/
3342    
3343    /A(*:A)B|XX(*:B)Y/K
3344        AABC
3345        XXYZ
3346        ** Failers
3347        XAQQ
3348        XAQQXZZ
3349        AXQQQ
3350        AXXQQQ
3351    
3352    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3353    optimizations defeat this. So does the PCRE optimization unless we disable it
3354    with \Y. ---/
3355    
3356    /(*COMMIT)ABC/
3357        ABCDEFG
3358        ** Failers
3359        DEFGABC\Y
3360    
3361    /--- Repeat some tests with added studying. ---/
3362    
3363    /A(*COMMIT)B/+KS
3364        ACABX
3365    
3366    /A(*THEN)B|A(*THEN)C/KS
3367        AC
3368    
3369    /A(*PRUNE)B|A(*PRUNE)C/KS
3370        AC
3371    
3372    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
3373        AB
3374        CD
3375        ** Failers
3376        AC
3377        CB
3378    
3379    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
3380        AB
3381        CD
3382        ** Failers
3383        AC
3384        CB
3385    
3386    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
3387        AB
3388        CD
3389    
3390    /A(*PRUNE:A)B/KS
3391        ACAB
3392    
3393    /(*MARK:A)(*PRUNE:B)(C|X)/KS
3394        C
3395        D
3396    
3397    /(*MARK:A)(*THEN:B)(C|X)/KS
3398        C
3399        D
3400    
3401    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
3402        AAAC
3403    
3404    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
3405        AAAC
3406    
3407    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
3408        AAAC
3409    
3410    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
3411        AAAC
3412    
3413    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
3414        AAAC
3415    
3416    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
3417        AAAC
3418    
3419    /A(*:A)B|XX(*:B)Y/KS
3420        AABC
3421        XXYZ
3422        ** Failers
3423        XAQQ
3424        XAQQXZZ
3425        AXQQQ
3426        AXXQQQ
3427    
3428    /(*COMMIT)ABC/
3429        ABCDEFG
3430        ** Failers
3431        DEFGABC\Y
3432    
3433    /^(ab (c+(*THEN)cd) | xyz)/x
3434        abcccd
3435    
3436    /^(ab (c+(*PRUNE)cd) | xyz)/x
3437        abcccd
3438    
3439    /^(ab (c+(*FAIL)cd) | xyz)/x
3440        abcccd
3441    
3442    /--- Perl 5.11 gets some of these wrong ---/
3443    
3444    /(?>.(*ACCEPT))*?5/
3445        abcde
3446    
3447    /(.(*ACCEPT))*?5/
3448        abcde
3449    
3450    /(.(*ACCEPT))5/
3451        abcde
3452    
3453    /(.(*ACCEPT))*5/
3454        abcde
3455    
3456  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.496  
changed lines
  Added in v.511

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12