/[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 500 by ph10, Sat Mar 6 19:00:29 2010 UTC revision 598 by ph10, Sat May 7 15:37:31 2011 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 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 3198  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 8667  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 8760  No match Line 8787  No match
8787  No match  No match
8788      a\x85b      a\x85b
8789  No match  No match
8790    
8791    /(*ANY).*/g
8792        abc\r\ndef
8793     0: abc
8794     0:
8795     0: def
8796     0:
8797    
8798    /(*ANYCRLF).*/g
8799        abc\r\ndef
8800     0: abc
8801     0:
8802     0: def
8803     0:
8804    
8805    /(*CRLF).*/g
8806        abc\r\ndef
8807     0: abc
8808     0:
8809     0: def
8810     0:
8811    
8812  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
8813  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 9246  No match Line 9294  No match
9294   +0        ^     x   +0        ^     x
9295   +0         ^    x   +0         ^    x
9296  No match  No match
9297    
9298    /(*NO_START_OPT)xyz/C
9299      abcxyz
9300    --->abcxyz
9301    +15 ^          x
9302    +15  ^         x
9303    +15   ^        x
9304    +15    ^       x
9305    +16    ^^      y
9306    +17    ^ ^     z
9307    +18    ^  ^
9308     0: xyz
9309    
9310    /xyz/CY
9311      abcxyz
9312    --->abcxyz
9313     +0 ^          x
9314     +0  ^         x
9315     +0   ^        x
9316     +0    ^       x
9317     +1    ^^      y
9318     +2    ^ ^     z
9319     +3    ^  ^
9320     0: xyz
9321    
9322  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9323      "ab"      "ab"
# Line 10432  Partial match: abca Line 10504  Partial match: abca
10504      xxxxabcde\P\P      xxxxabcde\P\P
10505  Partial match: abcde  Partial match: abcde
10506    
10507  /-- This is not in the Perl 5.10 test because Perl seems currently to be broken  /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10508      and not behaving as specified in that it *does* bumpalong after hitting      broken and not behaving as specified in that it *does* bumpalong after
10509      (*COMMIT). --/      hitting (*COMMIT). --/
10510    
10511  /(?1)(A(*COMMIT)|B)D/  /(?1)(A(*COMMIT)|B)D/
10512      ABD      ABD
# Line 10637  No match Line 10709  No match
10709          End          End
10710  ------------------------------------------------------------------  ------------------------------------------------------------------
10711    
10712  / -- The first four of these are not in the Perl 5.10 test because Perl  / -- The first four of these are not in the Perl >= 5.10 test because Perl
10713       documents that the use of \K in assertions is "not well defined". The       documents that the use of \K in assertions is "not well defined". The
10714       last is here because Perl gives the match as "b" rather than "ab". I       last is here because Perl gives the match as "b" rather than "ab". I
10715       believe this to be a Perl bug. --/       believe this to be a Perl bug. --/
# Line 10665  No match Line 10737  No match
10737    
10738  /----------------------/  /----------------------/
10739    
10740    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10741    Failed: recursive call could loop indefinitely at offset 31
10742    
10743    /abc(*MARK:)pqr/
10744    Failed: (*MARK) must have an argument at offset 10
10745    
10746    /abc(*:)pqr/
10747    Failed: (*MARK) must have an argument at offset 6
10748    
10749    /abc(*FAIL:123)xyz/
10750    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10751    
10752    /--- This should, and does, fail. In Perl, it does not, which I think is a
10753         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10754    
10755    /A(*COMMIT)B/+K
10756        ACABX
10757    No match
10758    
10759    /--- These should be different, but in Perl 5.11 are not, which I think
10760         is a bug in Perl. ---/
10761    
10762    /A(*THEN)B|A(*THEN)C/K
10763        AC
10764     0: AC
10765    
10766    /A(*PRUNE)B|A(*PRUNE)C/K
10767        AC
10768    No match
10769    
10770    /--- A whole lot of tests of verbs with arguments are here rather than in test
10771         11 because Perl doesn't seem to follow its specification entirely
10772         correctly. ---/
10773    
10774    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10775         not clear how Perl defines "involved in the failure of the match". ---/
10776    
10777    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10778        AB
10779     0: AB
10780     1: AB
10781        CD
10782     0: CD
10783     1: CD
10784        ** Failers
10785    No match
10786        AC
10787    No match
10788        CB
10789    No match, mark = B
10790    
10791    /--- Check the use of names for success and failure. PCRE doesn't show these
10792    names for success, though Perl does, contrary to its spec. ---/
10793    
10794    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
10795        AB
10796     0: AB
10797     1: AB
10798        CD
10799     0: CD
10800     1: CD
10801        ** Failers
10802    No match
10803        AC
10804    No match, mark = A
10805        CB
10806    No match, mark = B
10807    
10808    /--- An empty name does not pass back an empty string. It is the same as if no
10809    name were given. ---/
10810    
10811    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
10812        AB
10813     0: AB
10814     1: AB
10815        CD
10816     0: CD
10817     1: CD
10818    
10819    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
10820    
10821    /A(*PRUNE:A)B/K
10822        ACAB
10823     0: AB
10824    
10825    /(*MARK:A)(*PRUNE:B)(C|X)/K
10826        C
10827     0: C
10828     1: C
10829    MK: A
10830        D
10831    No match, mark = B
10832    
10833    /(*MARK:A)(*THEN:B)(C|X)/K
10834        C
10835     0: C
10836     1: C
10837    MK: A
10838        D
10839    No match, mark = B
10840    
10841    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
10842    
10843    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
10844        AAAC
10845    No match
10846    
10847    /--- Same --/
10848    
10849    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
10850        AAAC
10851    No match
10852    
10853    /--- This should fail; the SKIP advances by one, but when we get to AC, the
10854         PRUNE kills it. ---/
10855    
10856    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
10857        AAAC
10858    No match
10859    
10860    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
10861        AAAC
10862    No match
10863    
10864    /--- This should fail, as a null name is the same as no name ---/
10865    
10866    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
10867        AAAC
10868    No match
10869    
10870    /--- This fails in PCRE, and I think that is in accordance with Perl's
10871         documentation, though in Perl it succeeds. ---/
10872    
10873    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
10874        AAAC
10875    No match
10876    
10877    /--- Mark names can be duplicated ---/
10878    
10879    /A(*:A)B|X(*:A)Y/K
10880        AABC
10881     0: AB
10882    MK: A
10883        XXYZ
10884     0: XY
10885    MK: A
10886    
10887    /^A(*:A)B|^X(*:A)Y/K
10888        ** Failers
10889    No match
10890        XAQQ
10891    No match, mark = A
10892    
10893    /--- A check on what happens after hitting a mark and them bumping along to
10894    something that does not even start. Perl reports tags after the failures here,
10895    though it does not when the individual letters are made into something
10896    more complicated. ---/
10897    
10898    /A(*:A)B|XX(*:B)Y/K
10899        AABC
10900     0: AB
10901    MK: A
10902        XXYZ
10903     0: XXY
10904    MK: B
10905        ** Failers
10906    No match
10907        XAQQ
10908    No match
10909        XAQQXZZ
10910    No match
10911        AXQQQ
10912    No match
10913        AXXQQQ
10914    No match
10915    
10916    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
10917    optimizations defeat this. So does the PCRE optimization unless we disable it
10918    with \Y. ---/
10919    
10920    /(*COMMIT)ABC/
10921        ABCDEFG
10922     0: ABC
10923        ** Failers
10924    No match
10925        DEFGABC\Y
10926    No match
10927    
10928    /--- Repeat some tests with added studying. ---/
10929    
10930    /A(*COMMIT)B/+KS
10931        ACABX
10932    No match
10933    
10934    /A(*THEN)B|A(*THEN)C/KS
10935        AC
10936     0: AC
10937    
10938    /A(*PRUNE)B|A(*PRUNE)C/KS
10939        AC
10940    No match
10941    
10942    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
10943        AB
10944     0: AB
10945     1: AB
10946        CD
10947     0: CD
10948     1: CD
10949        ** Failers
10950    No match
10951        AC
10952    No match
10953        CB
10954    No match, mark = B
10955    
10956    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
10957        AB
10958     0: AB
10959     1: AB
10960        CD
10961     0: CD
10962     1: CD
10963        ** Failers
10964    No match
10965        AC
10966    No match, mark = A
10967        CB
10968    No match, mark = B
10969    
10970    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
10971        AB
10972     0: AB
10973     1: AB
10974        CD
10975     0: CD
10976     1: CD
10977    
10978    /A(*PRUNE:A)B/KS
10979        ACAB
10980     0: AB
10981    
10982    /(*MARK:A)(*PRUNE:B)(C|X)/KS
10983        C
10984     0: C
10985     1: C
10986    MK: A
10987        D
10988    No match
10989    
10990    /(*MARK:A)(*THEN:B)(C|X)/KS
10991        C
10992     0: C
10993     1: C
10994    MK: A
10995        D
10996    No match
10997    
10998    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
10999        AAAC
11000    No match
11001    
11002    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11003        AAAC
11004    No match
11005    
11006    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11007        AAAC
11008    No match
11009    
11010    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11011        AAAC
11012    No match
11013    
11014    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11015        AAAC
11016    No match
11017    
11018    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11019        AAAC
11020    No match
11021    
11022    /A(*:A)B|XX(*:B)Y/KS
11023        AABC
11024     0: AB
11025    MK: A
11026        XXYZ
11027     0: XXY
11028    MK: B
11029        ** Failers
11030    No match
11031        XAQQ
11032    No match
11033        XAQQXZZ
11034    No match
11035        AXQQQ
11036    No match
11037        AXXQQQ
11038    No match
11039    
11040    /(*COMMIT)ABC/
11041        ABCDEFG
11042     0: ABC
11043        ** Failers
11044    No match
11045        DEFGABC\Y
11046    No match
11047    
11048    /^(ab (c+(*THEN)cd) | xyz)/x
11049        abcccd
11050    No match
11051    
11052    /^(ab (c+(*PRUNE)cd) | xyz)/x
11053        abcccd
11054    No match
11055    
11056    /^(ab (c+(*FAIL)cd) | xyz)/x
11057        abcccd
11058    No match
11059    
11060    /--- Perl 5.11 gets some of these wrong ---/
11061    
11062    /(?>.(*ACCEPT))*?5/
11063        abcde
11064     0: a
11065    
11066    /(.(*ACCEPT))*?5/
11067        abcde
11068     0: a
11069     1: a
11070    
11071    /(.(*ACCEPT))5/
11072        abcde
11073     0: a
11074     1: a
11075    
11076    /(.(*ACCEPT))*5/
11077        abcde
11078     0: a
11079     1: a
11080    
11081    /A\NB./BZ
11082    ------------------------------------------------------------------
11083            Bra
11084            A
11085            Any
11086            B
11087            Any
11088            Ket
11089            End
11090    ------------------------------------------------------------------
11091        ACBD
11092     0: ACBD
11093        *** Failers
11094    No match
11095        A\nB
11096    No match
11097        ACB\n
11098    No match
11099    
11100    /A\NB./sBZ
11101    ------------------------------------------------------------------
11102            Bra
11103            A
11104            Any
11105            B
11106            AllAny
11107            Ket
11108            End
11109    ------------------------------------------------------------------
11110        ACBD
11111     0: ACBD
11112        ACB\n
11113     0: ACB\x0a
11114        *** Failers
11115    No match
11116        A\nB
11117    No match
11118    
11119    /A\NB/<crlf>
11120        A\nB
11121     0: A\x0aB
11122        A\rB
11123     0: A\x0dB
11124        ** Failers
11125    No match
11126        A\r\nB
11127    No match
11128    
11129    /\R+b/BZ
11130    ------------------------------------------------------------------
11131            Bra
11132            \R++
11133            b
11134            Ket
11135            End
11136    ------------------------------------------------------------------
11137    
11138    /\R+\n/BZ
11139    ------------------------------------------------------------------
11140            Bra
11141            \R+
11142            \x0a
11143            Ket
11144            End
11145    ------------------------------------------------------------------
11146    
11147    /\R+\d/BZ
11148    ------------------------------------------------------------------
11149            Bra
11150            \R++
11151            \d
11152            Ket
11153            End
11154    ------------------------------------------------------------------
11155    
11156    /\d*\R/BZ
11157    ------------------------------------------------------------------
11158            Bra
11159            \d*+
11160            \R
11161            Ket
11162            End
11163    ------------------------------------------------------------------
11164    
11165    /\s*\R/BZ
11166    ------------------------------------------------------------------
11167            Bra
11168            \s*+
11169            \R
11170            Ket
11171            End
11172    ------------------------------------------------------------------
11173    
11174    /-- Perl treats this one differently, not failing the second string. I believe
11175        that is a bug in Perl. --/
11176    
11177    /^((abc|abcx)(*THEN)y|abcd)/
11178        abcd
11179     0: abcd
11180     1: abcd
11181        *** Failers
11182    No match
11183        abcxy
11184    No match
11185    
11186    /(?<=abc)def/
11187        abc\P\P
11188    Partial match: abc
11189    
11190    /abc$/
11191        abc
11192     0: abc
11193        abc\P
11194     0: abc
11195        abc\P\P
11196    Partial match: abc
11197    
11198    /abc$/m
11199        abc
11200     0: abc
11201        abc\n
11202     0: abc
11203        abc\P\P
11204    Partial match: abc
11205        abc\n\P\P
11206     0: abc
11207        abc\P
11208     0: abc
11209        abc\n\P
11210     0: abc
11211    
11212    /abc\z/
11213        abc
11214     0: abc
11215        abc\P
11216     0: abc
11217        abc\P\P
11218    Partial match: abc
11219    
11220    /abc\Z/
11221        abc
11222     0: abc
11223        abc\P
11224     0: abc
11225        abc\P\P
11226    Partial match: abc
11227    
11228    /abc\b/
11229        abc
11230     0: abc
11231        abc\P
11232     0: abc
11233        abc\P\P
11234    Partial match: abc
11235    
11236    /abc\B/
11237        abc
11238    No match
11239        abc\P
11240    Partial match: abc
11241        abc\P\P
11242    Partial match: abc
11243    
11244    /.+/
11245        abc\>0
11246     0: abc
11247        abc\>1
11248     0: bc
11249        abc\>2
11250     0: c
11251        abc\>3
11252    No match
11253        abc\>4
11254    Error -24 (bad offset value)
11255        abc\>-4
11256    Error -24 (bad offset value)
11257    
11258    /^\cģ/
11259    Failed: \c must be followed by an ASCII character at offset 3
11260    
11261    /(?P<abn>(?P=abn)xxx)/BZ
11262    ------------------------------------------------------------------
11263            Bra
11264            Once
11265            CBra 1
11266            \1
11267            xxx
11268            Ket
11269            Ket
11270            Ket
11271            End
11272    ------------------------------------------------------------------
11273    
11274    /(a\1z)/BZ
11275    ------------------------------------------------------------------
11276            Bra
11277            Once
11278            CBra 1
11279            a
11280            \1
11281            z
11282            Ket
11283            Ket
11284            Ket
11285            End
11286    ------------------------------------------------------------------
11287    
11288    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11289    Failed: syntax error in subpattern name (missing terminator) at offset 29
11290    
11291    /(?P<abn>(?P=axn)xxx)/BZ
11292    Failed: reference to non-existent subpattern at offset 15
11293    
11294    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11295    ------------------------------------------------------------------
11296            Bra
11297            CBra 1
11298            \2
11299            xxx
11300            Ket
11301            CBra 2
11302            yy
11303            Ket
11304            Ket
11305            End
11306    ------------------------------------------------------------------
11307    
11308  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.500  
changed lines
  Added in v.598

  ViewVC Help
Powered by ViewVC 1.1.5