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

Diff of /code/trunk/testdata/testoutput2

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

revision 472 by ph10, Fri Dec 11 16:42:50 2009 UTC revision 553 by ph10, Fri Oct 22 15:57:50 2010 UTC
# Line 2  Line 2 
2      of PCRE's API, error diagnostics, and the compiled code of some patterns.      of PCRE's API, error diagnostics, and the compiled code of some patterns.
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 potential Perl      either because PCRE can't be compatible, or there is a possible Perl
6      bug. --/      bug. --/
7    
8  /-- Originally, the Perl 5.10 things were in here too, but now I have separated  /-- Originally, the Perl 5.10 and 5.11 things were in here too, but now I have
9      many (most?) of them out into test 11. However, there may still be some      separated many (most?) of them out into test 11. However, there may still
10      that were overlooked. --/      be some that were overlooked. --/
11    
12  /(a)b|/I  /(a)b|/I
13  Capturing subpattern count = 1  Capturing subpattern count = 1
# Line 103  Failed: missing terminating ] for charac Line 103  Failed: missing terminating ] for charac
103  /(?X)[\B]/  /(?X)[\B]/
104  Failed: invalid escape sequence in character class at offset 6  Failed: invalid escape sequence in character class at offset 6
105    
106    /(?X)[\R]/
107    Failed: invalid escape sequence in character class at offset 6
108    
109    /(?X)[\X]/
110    Failed: invalid escape sequence in character class at offset 6
111    
112    /[\B]/BZ
113    ------------------------------------------------------------------
114            Bra
115            B
116            Ket
117            End
118    ------------------------------------------------------------------
119    
120    /[\R]/BZ
121    ------------------------------------------------------------------
122            Bra
123            R
124            Ket
125            End
126    ------------------------------------------------------------------
127    
128    /[\X]/BZ
129    ------------------------------------------------------------------
130            Bra
131            X
132            Ket
133            End
134    ------------------------------------------------------------------
135    
136  /[z-a]/  /[z-a]/
137  Failed: range out of order in character class at offset 3  Failed: range out of order in character class at offset 3
138    
# Line 857  No match Line 887  No match
887      a      a
888  No match  No match
889    
890  /This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I  /This one is here because Perl behaves differently; see also the following/I
891  Capturing subpattern count = 0  Capturing subpattern count = 0
892  No options  No options
893  First char = 'T'  First char = 'T'
# Line 869  Max back reference = 1 Line 899  Max back reference = 1
899  Options: anchored  Options: anchored
900  No first char  No first char
901  No need char  No need char
902        aaaa
903    No match
904      aaaaaa      aaaaaa
905   0: aaaaaa  No match
906   1: aa  
907    /Perl does not fail these two for the final subjects. Neither did PCRE until/
908    /release 8.01. The problem is in backtracking into a subpattern that contains/
909    No match
910    /a recursive reference to itself. PCRE has now made these into atomic patterns./
911    No match
912    
913    /^(xa|=?\1a){2}$/
914        xa=xaa
915     0: xa=xaa
916     1: =xaa
917        ** Failers
918    No match
919        xa=xaaa
920    No match
921    
922    /^(xa|=?\1a)+$/
923        xa=xaa
924     0: xa=xaa
925     1: =xaa
926        ** Failers
927    No match
928        xa=xaaa
929    No match
930    
931  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
932  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 3173  Failed: POSIX collating elements are not Line 3228  Failed: POSIX collating elements are not
3228  Failed: POSIX named classes are supported only within a class at offset 0  Failed: POSIX named classes are supported only within a class at offset 0
3229    
3230  /\l/I  /\l/I
3231  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3232    
3233  /\L/I  /\L/I
3234  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3235    
3236  /\N{name}/I  /\N{name}/I
3237  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3238    
3239  /\u/I  /\u/I
3240  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3241    
3242  /\U/I  /\U/I
3243  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3244    
3245  /[/I  /[/I
3246  Failed: missing terminating ] for character class at offset 1  Failed: missing terminating ] for character class at offset 1
# Line 8642  No match Line 8697  No match
8697  +13   ^  ^      (*FAIL)  +13   ^  ^      (*FAIL)
8698  No match  No match
8699    
 /a(*PRUNE:XXX)b/  
 Failed: (*VERB) with an argument is not supported at offset 8  
   
8700  /a(*MARK)b/  /a(*MARK)b/
8701  Failed: (*VERB) not recognized at offset 7  Failed: (*MARK) must have an argument at offset 7
8702    
8703  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
8704  Failed: number is too big at offset 19  Failed: number is too big at offset 19
# Line 10535  No match Line 10587  No match
10587          End          End
10588  ------------------------------------------------------------------  ------------------------------------------------------------------
10589    
10590    /^(ab(c\1)d|x){2}$/BZ
10591    ------------------------------------------------------------------
10592            Bra
10593            ^
10594            Once
10595            CBra 1
10596            ab
10597            CBra 2
10598            c
10599            \1
10600            Ket
10601            d
10602            Alt
10603            x
10604            Ket
10605            Ket
10606            Once
10607            CBra 1
10608            ab
10609            CBra 2
10610            c
10611            \1
10612            Ket
10613            d
10614            Alt
10615            x
10616            Ket
10617            Ket
10618            $
10619            Ket
10620            End
10621    ------------------------------------------------------------------
10622        xabcxd
10623     0: xabcxd
10624     1: abcxd
10625     2: cx
10626    
10627    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10628    ------------------------------------------------------------------
10629            Bra
10630            ^
10631            Once
10632            Brazero
10633            Once
10634            Recurse
10635            KetRmax
10636            Ket
10637            Cond
10638            Cond def
10639            CBra 1
10640            Any
10641            Ket
10642            Ket
10643            $
10644            Ket
10645            End
10646    ------------------------------------------------------------------
10647    
10648    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10649    ------------------------------------------------------------------
10650            Bra
10651            ^
10652            Brazero
10653            Once
10654            Recurse
10655            KetRmax
10656            Cond
10657            Cond def
10658            CBra 1
10659            Any
10660            Ket
10661            Ket
10662            $
10663            Ket
10664            End
10665    ------------------------------------------------------------------
10666    
10667    / -- The first four of these are not in the Perl 5.10 test because Perl
10668         documents that the use of \K in assertions is "not well defined". The
10669         last is here because Perl gives the match as "b" rather than "ab". I
10670         believe this to be a Perl bug. --/
10671    
10672    /(?=a\Kb)ab/
10673        ab
10674     0: b
10675    
10676    /(?!a\Kb)ac/
10677        ac
10678     0: ac
10679    
10680    /^abc(?<=b\Kc)d/
10681        abcd
10682     0: cd
10683    
10684    /^abc(?<!b\Kq)d/
10685        abcd
10686     0: abcd
10687    
10688    /(?>a\Kb)z|(ab)/
10689        ab
10690     0: ab
10691     1: ab
10692    
10693    /----------------------/
10694    
10695    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10696    Failed: recursive call could loop indefinitely at offset 31
10697    
10698    /abc(*MARK:)pqr/
10699    Failed: (*MARK) must have an argument at offset 10
10700    
10701    /abc(*:)pqr/
10702    Failed: (*MARK) must have an argument at offset 6
10703    
10704    /abc(*FAIL:123)xyz/
10705    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10706    
10707    /--- This should, and does, fail. In Perl, it does not, which I think is a
10708         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10709    
10710    /A(*COMMIT)B/+K
10711        ACABX
10712    No match
10713    
10714    /--- These should be different, but in Perl 5.11 are not, which I think
10715         is a bug in Perl. ---/
10716    
10717    /A(*THEN)B|A(*THEN)C/K
10718        AC
10719     0: AC
10720    
10721    /A(*PRUNE)B|A(*PRUNE)C/K
10722        AC
10723    No match
10724    
10725    /--- A whole lot of tests of verbs with arguments are here rather than in test
10726         11 because Perl doesn't seem to follow its specification entirely
10727         correctly. ---/
10728    
10729    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10730         not clear how Perl defines "involved in the failure of the match". ---/
10731    
10732    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10733        AB
10734     0: AB
10735     1: AB
10736        CD
10737     0: CD
10738     1: CD
10739        ** Failers
10740    No match
10741        AC
10742    No match
10743        CB
10744    No match, mark = B
10745    
10746    /--- Check the use of names for success and failure. PCRE doesn't show these
10747    names for success, though Perl does, contrary to its spec. ---/
10748    
10749    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
10750        AB
10751     0: AB
10752     1: AB
10753        CD
10754     0: CD
10755     1: CD
10756        ** Failers
10757    No match
10758        AC
10759    No match, mark = A
10760        CB
10761    No match, mark = B
10762    
10763    /--- An empty name does not pass back an empty string. It is the same as if no
10764    name were given. ---/
10765    
10766    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
10767        AB
10768     0: AB
10769     1: AB
10770        CD
10771     0: CD
10772     1: CD
10773    
10774    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
10775    
10776    /A(*PRUNE:A)B/K
10777        ACAB
10778     0: AB
10779    
10780    /(*MARK:A)(*PRUNE:B)(C|X)/K
10781        C
10782     0: C
10783     1: C
10784    MK: A
10785        D
10786    No match, mark = B
10787    
10788    /(*MARK:A)(*THEN:B)(C|X)/K
10789        C
10790     0: C
10791     1: C
10792    MK: A
10793        D
10794    No match, mark = B
10795    
10796    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
10797    
10798    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
10799        AAAC
10800    No match
10801    
10802    /--- Same --/
10803    
10804    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
10805        AAAC
10806    No match
10807    
10808    /--- This should fail; the SKIP advances by one, but when we get to AC, the
10809         PRUNE kills it. ---/
10810    
10811    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
10812        AAAC
10813    No match
10814    
10815    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
10816        AAAC
10817    No match
10818    
10819    /--- This should fail, as a null name is the same as no name ---/
10820    
10821    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
10822        AAAC
10823    No match
10824    
10825    /--- This fails in PCRE, and I think that is in accordance with Perl's
10826         documentation, though in Perl it succeeds. ---/
10827    
10828    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
10829        AAAC
10830    No match
10831    
10832    /--- Mark names can be duplicated ---/
10833    
10834    /A(*:A)B|X(*:A)Y/K
10835        AABC
10836     0: AB
10837    MK: A
10838        XXYZ
10839     0: XY
10840    MK: A
10841    
10842    /^A(*:A)B|^X(*:A)Y/K
10843        ** Failers
10844    No match
10845        XAQQ
10846    No match, mark = A
10847    
10848    /--- A check on what happens after hitting a mark and them bumping along to
10849    something that does not even start. Perl reports tags after the failures here,
10850    though it does not when the individual letters are made into something
10851    more complicated. ---/
10852    
10853    /A(*:A)B|XX(*:B)Y/K
10854        AABC
10855     0: AB
10856    MK: A
10857        XXYZ
10858     0: XXY
10859    MK: B
10860        ** Failers
10861    No match
10862        XAQQ
10863    No match
10864        XAQQXZZ
10865    No match
10866        AXQQQ
10867    No match
10868        AXXQQQ
10869    No match
10870    
10871    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
10872    optimizations defeat this. So does the PCRE optimization unless we disable it
10873    with \Y. ---/
10874    
10875    /(*COMMIT)ABC/
10876        ABCDEFG
10877     0: ABC
10878        ** Failers
10879    No match
10880        DEFGABC\Y
10881    No match
10882    
10883    /--- Repeat some tests with added studying. ---/
10884    
10885    /A(*COMMIT)B/+KS
10886        ACABX
10887    No match
10888    
10889    /A(*THEN)B|A(*THEN)C/KS
10890        AC
10891     0: AC
10892    
10893    /A(*PRUNE)B|A(*PRUNE)C/KS
10894        AC
10895    No match
10896    
10897    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
10898        AB
10899     0: AB
10900     1: AB
10901        CD
10902     0: CD
10903     1: CD
10904        ** Failers
10905    No match
10906        AC
10907    No match
10908        CB
10909    No match, mark = B
10910    
10911    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
10912        AB
10913     0: AB
10914     1: AB
10915        CD
10916     0: CD
10917     1: CD
10918        ** Failers
10919    No match
10920        AC
10921    No match, mark = A
10922        CB
10923    No match, mark = B
10924    
10925    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
10926        AB
10927     0: AB
10928     1: AB
10929        CD
10930     0: CD
10931     1: CD
10932    
10933    /A(*PRUNE:A)B/KS
10934        ACAB
10935     0: AB
10936    
10937    /(*MARK:A)(*PRUNE:B)(C|X)/KS
10938        C
10939     0: C
10940     1: C
10941    MK: A
10942        D
10943    No match
10944    
10945    /(*MARK:A)(*THEN:B)(C|X)/KS
10946        C
10947     0: C
10948     1: C
10949    MK: A
10950        D
10951    No match
10952    
10953    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
10954        AAAC
10955    No match
10956    
10957    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
10958        AAAC
10959    No match
10960    
10961    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
10962        AAAC
10963    No match
10964    
10965    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
10966        AAAC
10967    No match
10968    
10969    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
10970        AAAC
10971    No match
10972    
10973    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
10974        AAAC
10975    No match
10976    
10977    /A(*:A)B|XX(*:B)Y/KS
10978        AABC
10979     0: AB
10980    MK: A
10981        XXYZ
10982     0: XXY
10983    MK: B
10984        ** Failers
10985    No match
10986        XAQQ
10987    No match
10988        XAQQXZZ
10989    No match
10990        AXQQQ
10991    No match
10992        AXXQQQ
10993    No match
10994    
10995    /(*COMMIT)ABC/
10996        ABCDEFG
10997     0: ABC
10998        ** Failers
10999    No match
11000        DEFGABC\Y
11001    No match
11002    
11003    /^(ab (c+(*THEN)cd) | xyz)/x
11004        abcccd
11005    No match
11006    
11007    /^(ab (c+(*PRUNE)cd) | xyz)/x
11008        abcccd
11009    No match
11010    
11011    /^(ab (c+(*FAIL)cd) | xyz)/x
11012        abcccd
11013    No match
11014    
11015    /--- Perl 5.11 gets some of these wrong ---/
11016    
11017    /(?>.(*ACCEPT))*?5/
11018        abcde
11019     0: a
11020    
11021    /(.(*ACCEPT))*?5/
11022        abcde
11023     0: a
11024     1: a
11025    
11026    /(.(*ACCEPT))5/
11027        abcde
11028     0: a
11029     1: a
11030    
11031    /(.(*ACCEPT))*5/
11032        abcde
11033     0: a
11034     1: a
11035    
11036    /A\NB./BZ
11037    ------------------------------------------------------------------
11038            Bra
11039            A
11040            Any
11041            B
11042            Any
11043            Ket
11044            End
11045    ------------------------------------------------------------------
11046        ACBD
11047     0: ACBD
11048        *** Failers
11049    No match
11050        A\nB
11051    No match
11052        ACB\n
11053    No match
11054    
11055    /A\NB./sBZ
11056    ------------------------------------------------------------------
11057            Bra
11058            A
11059            Any
11060            B
11061            AllAny
11062            Ket
11063            End
11064    ------------------------------------------------------------------
11065        ACBD
11066     0: ACBD
11067        ACB\n
11068     0: ACB\x0a
11069        *** Failers
11070    No match
11071        A\nB
11072    No match
11073    
11074    /A\NB/<crlf>
11075        A\nB
11076     0: A\x0aB
11077        A\rB
11078     0: A\x0dB
11079        ** Failers
11080    No match
11081        A\r\nB
11082    No match
11083    
11084    /\R+b/BZ
11085    ------------------------------------------------------------------
11086            Bra
11087            \R++
11088            b
11089            Ket
11090            End
11091    ------------------------------------------------------------------
11092    
11093    /\R+\n/BZ
11094    ------------------------------------------------------------------
11095            Bra
11096            \R+
11097            \x0a
11098            Ket
11099            End
11100    ------------------------------------------------------------------
11101    
11102    /\R+\d/BZ
11103    ------------------------------------------------------------------
11104            Bra
11105            \R++
11106            \d
11107            Ket
11108            End
11109    ------------------------------------------------------------------
11110    
11111    /\d*\R/BZ
11112    ------------------------------------------------------------------
11113            Bra
11114            \d*+
11115            \R
11116            Ket
11117            End
11118    ------------------------------------------------------------------
11119    
11120    /\s*\R/BZ
11121    ------------------------------------------------------------------
11122            Bra
11123            \s*+
11124            \R
11125            Ket
11126            End
11127    ------------------------------------------------------------------
11128    
11129    /-- Perl treats this one differently, not failing the second string. I believe
11130        that is a bug in Perl. --/
11131    
11132    /^((abc|abcx)(*THEN)y|abcd)/
11133        abcd
11134     0: abcd
11135     1: abcd
11136        *** Failers
11137    No match
11138        abcxy
11139    No match
11140    
11141    /(?<=abc)def/
11142        abc\P\P
11143    Partial match: abc
11144    
11145    /abc$/
11146        abc
11147     0: abc
11148        abc\P
11149     0: abc
11150        abc\P\P
11151    Partial match: abc
11152    
11153    /abc$/m
11154        abc
11155     0: abc
11156        abc\n
11157     0: abc
11158        abc\P\P
11159    Partial match: abc
11160        abc\n\P\P
11161     0: abc
11162        abc\P
11163     0: abc
11164        abc\n\P
11165     0: abc
11166    
11167    /abc\z/
11168        abc
11169     0: abc
11170        abc\P
11171     0: abc
11172        abc\P\P
11173    Partial match: abc
11174    
11175    /abc\Z/
11176        abc
11177     0: abc
11178        abc\P
11179     0: abc
11180        abc\P\P
11181    Partial match: abc
11182    
11183    /abc\b/
11184        abc
11185     0: abc
11186        abc\P
11187     0: abc
11188        abc\P\P
11189    Partial match: abc
11190    
11191    /abc\B/
11192        abc
11193    No match
11194        abc\P
11195    Partial match: abc
11196        abc\P\P
11197    Partial match: abc
11198    
11199  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.472  
changed lines
  Added in v.553

  ViewVC Help
Powered by ViewVC 1.1.5