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 = 5
     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     ab!deXYZ
     21  0: X
     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         AllAny+
     40         extuni
     41         extuni+
     42         AllAny
     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 No match
     65     X\x{11234}YZ
     66  0: X\x{11234}YZ
     67  1: \x{11234}YZ
     68 
     69 /X(\C{4})/utf
     70     X\x{1234}YZ
     71 No match
     72     X\x{11234}YZ
     73 No match
     74     X\x{11234}YZW
     75  0: X\x{11234}YZW
     76  1: \x{11234}YZW
     77 
     78 /X\C*/utf
     79     XYZabcdce
     80  0: XYZabcdce
     81 
     82 /X\C*?/utf
     83     XYZabcde
     84  0: X
     85 
     86 /X\C{3,5}/utf
     87     Xabcdefg
     88  0: Xabcde
     89     X\x{1234}
     90 No match
     91     X\x{1234}YZ
     92  0: X\x{1234}YZ
     93     X\x{1234}\x{512}
     94 No match
     95     X\x{1234}\x{512}YZ
     96  0: X\x{1234}\x{512}YZ
     97     X\x{11234}Y
     98 No match
     99     X\x{11234}YZ
    100  0: X\x{11234}YZ
    101     X\x{11234}\x{512}
    102 No match
    103     X\x{11234}\x{512}YZ
    104  0: X\x{11234}\x{512}YZ
    105     X\x{11234}\x{512}\x{11234}Z
    106  0: X\x{11234}\x{512}\x{11234}Z
    107 
    108 /X\C{3,5}?/utf
    109     Xabcdefg
    110  0: Xabc
    111     X\x{1234}
    112 No match
    113     X\x{1234}YZ
    114  0: X\x{1234}YZ
    115     X\x{1234}\x{512}
    116 No match
    117     X\x{11234}Y
    118 No match
    119     X\x{11234}YZ
    120  0: X\x{11234}YZ
    121     X\x{11234}\x{512}YZ
    122  0: X\x{11234}\x{512}Y
    123     X\x{11234}
    124 No match
    125 
    126 /a\Cb/utf
    127     aXb
    128  0: aXb
    129     a\nb
    130  0: a\x{0a}b
    131     a\x{100}b
    132  0: a\x{100}b
    133 
    134 /a\C\Cb/utf
    135     a\x{100}b
    136 No match
    137     a\x{12257}b
    138 No match
    139     a\x{12257}\x{11234}b
    140  0: a\x{12257}\x{11234}b
    141 
    142 /ab\Cde/utf
    143     abXde
    144  0: abXde
    145 
    146 # This one is here not because it's different to Perl, but because the way
    147 # the captured single code unit is displayed. (In Perl it becomes a character,
    148 # and you can't tell the difference.)
    149 
    150 /X(\C)(.*)/utf
    151     X\x{1234}
    152  0: X\x{1234}
    153  1: \x{1234}
    154  2: 
    155     X\nabc
    156  0: X\x{0a}abc
    157  1: \x{0a}
    158  2: abc
    159 
    160 # This one is here because Perl gives out a grumbly error message (quite
    161 # correctly, but that messes up comparisons).
    162 
    163 /a\Cb/utf
    164 \= Expect no match in 8-bit mode
    165     a\x{100}b
    166  0: a\x{100}b
    167 
    168 # End of testinput22
    169