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
7Capture group count = 0
8Contains \C
9Options: utf
10First code unit = 'a'
11Last code unit = 'e'
12Subject length lower bound = 2
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
20Failed: error 136 at offset 0: \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+
49F
50/utf
51\= Expect no match
52    Ӆ\x0a
53No match
54
55/\C(\W?ſ)'?{{/utf
56\= Expect no match
57    \\C(\\W?ſ)'?{{
58No match
59
60/X(\C{3})/utf
61    X\x{1234}
62No 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
72No 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}
92No match
93    X\x{1234}YZ
94 0: X\x{1234}YZ
95    X\x{1234}\x{512}
96No 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}
114No match
115    X\x{1234}YZ
116 0: X\x{1234}YZ
117    X\x{1234}\x{512}
118No 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}
126No 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
138No match
139    a\x{12257}b
140 0: a\x{12257}b
141    a\x{12257}\x{11234}b
142No 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/^ab\C/utf,no_start_optimize
171\= Expect no match - tests \C at end of subject
172    ab
173No match
174
175/\C[^\v]+\x80/utf
176    [AΏBŀC]
177No match
178
179/\C[^\d]+\x80/utf
180    [AΏBŀC]
181No match
182
183# End of testinput22
184