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

Diff of /code/trunk/testdata/testinput11

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

revision 509 by ph10, Sun Mar 7 17:35:52 2010 UTC revision 510 by ph10, Sat Mar 27 17:45:29 2010 UTC
# Line 389  Line 389 
389      00      00
390      0000      0000
391    
392    /--- This one does fail, as expected, in Perl. It needs the complex item at the
393         end of the pattern. A single letter instead of (B|D) makes it not fail,
394         which I think is a Perl bug. --- /
395    
396    /A(*COMMIT)(B|D)/
397        ACABX
398    
399    /--- Check the use of names for failure ---/
400    
401    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
402        ** Failers
403        AC
404        CB
405    
406    /(*MARK:A)(*SKIP:B)(C|X)/K
407        C
408        D
409    
410    /^(A(*THEN:A)B|C(*THEN:B)D)/K
411        ** Failers
412        CB
413    
414    /^(?:A(*THEN:A)B|C(*THEN:B)D)/K
415        CB
416    
417    /^(?>A(*THEN:A)B|C(*THEN:B)D)/K
418        CB
419    
420    /--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
421    that we have to have something complicated such as (B|Z) at the end because,
422    for Perl, a simple character somehow causes an unwanted optimization to mess
423    with the handling of backtracking verbs. ---/
424    
425    /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
426        AAAC
427    
428    /--- Test skipping over a non-matching mark. ---/
429    
430    /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
431        AAAC
432    
433    /--- Check shorthand for MARK ---/
434    
435    /A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
436        AAAC
437    
438    /--- This should succeed, as a non-existent skip name disables the skip ---/
439    
440    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
441        AAAC
442    
443    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
444        AAAC
445    
446    /--- We use something more complicated than individual letters here, because
447    that causes different behaviour in Perl. Perhaps it disables some optimization;
448    anyway, the result now matches PCRE in that no tag is passed back for the
449    failures. ---/
450    
451    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
452        AABC
453        XXYZ
454        ** Failers
455        XAQQ
456        XAQQXZZ
457        AXQQQ
458        AXXQQQ
459    
460    /--- COMMIT at the start of a pattern should act like an anchor. Again,
461    however, we need the complication for Perl. ---/
462    
463    /(*COMMIT)(A|P)(B|P)(C|P)/
464        ABCDEFG
465        ** Failers
466        DEFGABC
467    
468    /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
469    
470    /(\w+)(?>b(*COMMIT))\w{2}/
471        abbb
472    
473    /(\w+)b(*COMMIT)\w{2}/
474        abbb
475    
476  /-- End of testinput11 --/  /-- End of testinput11 --/

Legend:
Removed from v.509  
changed lines
  Added in v.510

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12