Home | History | Annotate | Download | only in testdata
      1 # Tests of \C when Unicode support is available. Note that \C is not supported
      2 # for DFA matching in UTF mode, so this test is not run with -dfa. The output
      3 # of this test is different in 8-, 16-, and 32-bit modes. Some tests may match
      4 # in some widths and not in others.
      5 
      6 /ab\Cde/utf,info
      7 Capturing subpattern count = 0
      8 Contains \C
      9 Options: utf
     10 First code unit = 'a'
     11 Last code unit = 'e'
     12 Subject length lower bound = 0
     13     abXde
     14  0: abXde
     15 
     16 # This should produce an error diagnostic (\C in UTF lookbehind) in 8-bit and
     17 # 16-bit modes, but not in 32-bit mode.
     18 
     19 /(?<=ab\Cde)X/utf
     20 Failed: error 136 at offset 10: \C is not allowed in a lookbehind assertion in UTF-16 mode
     21     ab!deXYZ
     22 
     23 # Autopossessification tests
     24 
     25 /\C+\X \X+\C/Bx
     26 ------------------------------------------------------------------
     27         Bra
     28         AllAny+
     29         extuni
     30         extuni+
     31         AllAny
     32         Ket
     33         End
     34 ------------------------------------------------------------------
     35 
     36 /\C+\X \X+\C/Bx,utf
     37 ------------------------------------------------------------------
     38         Bra
     39         Anybyte+
     40         extuni
     41         extuni+
     42         Anybyte
     43         Ket
     44         End
     45 ------------------------------------------------------------------
     46 
     47 /\C\X*T;
     48 {0,6}\v+
F
     50 /utf
     51 \= Expect no match
     52     \x0a
     53 No match
     54 
     55 /\C(\W?)'?{{/utf
     56 \= Expect no match
     57     \\C(\\W?)'?{{
     58 No match
     59 
     60 /X(\C{3})/utf
     61     X\x{1234}
     62 No match
     63     X\x{11234}Y
     64  0: X\x{11234}Y
     65  1: \x{11234}Y
     66     X\x{11234}YZ
     67  0: X\x{11234}Y
     68  1: \x{11234}Y
     69 
     70 /X(\C{4})/utf
     71     X\x{1234}YZ
     72 No match
     73     X\x{11234}YZ
     74  0: X\x{11234}YZ
     75  1: \x{11234}YZ
     76     X\x{11234}YZW
     77  0: X\x{11234}YZ
     78  1: \x{11234}YZ
     79 
     80 /X\C*/utf
     81     XYZabcdce
     82  0: XYZabcdce
     83 
     84 /X\C*?/utf
     85     XYZabcde
     86  0: X
     87 
     88 /X\C{3,5}/utf
     89     Xabcdefg
     90  0: Xabcde
     91     X\x{1234}
     92 No match
     93     X\x{1234}YZ
     94  0: X\x{1234}YZ
     95     X\x{1234}\x{512}
     96 No match
     97     X\x{1234}\x{512}YZ
     98  0: X\x{1234}\x{512}YZ
     99     X\x{11234}Y
    100  0: X\x{11234}Y
    101     X\x{11234}YZ
    102  0: X\x{11234}YZ
    103     X\x{11234}\x{512}
    104  0: X\x{11234}\x{512}
    105     X\x{11234}\x{512}YZ
    106  0: X\x{11234}\x{512}YZ
    107     X\x{11234}\x{512}\x{11234}Z
    108  0: X\x{11234}\x{512}\x{11234}
    109 
    110 /X\C{3,5}?/utf
    111     Xabcdefg
    112  0: Xabc
    113     X\x{1234}
    114 No match
    115     X\x{1234}YZ
    116  0: X\x{1234}YZ
    117     X\x{1234}\x{512}
    118 No match
    119     X\x{11234}Y
    120  0: X\x{11234}Y
    121     X\x{11234}YZ
    122  0: X\x{11234}Y
    123     X\x{11234}\x{512}YZ
    124  0: X\x{11234}\x{512}
    125     X\x{11234}
    126 No match
    127 
    128 /a\Cb/utf
    129     aXb
    130  0: aXb
    131     a\nb
    132  0: a\x{0a}b
    133     a\x{100}b
    134  0: a\x{100}b
    135 
    136 /a\C\Cb/utf
    137     a\x{100}b
    138 No match
    139     a\x{12257}b
    140  0: a\x{12257}b
    141     a\x{12257}\x{11234}b
    142 No match
    143 
    144 /ab\Cde/utf
    145     abXde
    146  0: abXde
    147 
    148 # This one is here not because it's different to Perl, but because the way
    149 # the captured single code unit is displayed. (In Perl it becomes a character,
    150 # and you can't tell the difference.)
    151 
    152 /X(\C)(.*)/utf
    153     X\x{1234}
    154  0: X\x{1234}
    155  1: \x{1234}
    156  2: 
    157     X\nabc
    158  0: X\x{0a}abc
    159  1: \x{0a}
    160  2: abc
    161 
    162 # This one is here because Perl gives out a grumbly error message (quite
    163 # correctly, but that messes up comparisons).
    164 
    165 /a\Cb/utf
    166 \= Expect no match in 8-bit mode
    167     a\x{100}b
    168  0: a\x{100}b
    169 
    170 # End of testinput22
    171