• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    abXde
8
9# This should produce an error diagnostic (\C in UTF lookbehind) in 8-bit and
10# 16-bit modes, but not in 32-bit mode.
11
12/(?<=ab\Cde)X/utf
13    ab!deXYZ
14
15# Autopossessification tests
16
17/\C+\X \X+\C/Bx
18
19/\C+\X \X+\C/Bx,utf
20
21/\C\X*TӅ;
22{0,6}\v+
23F
24/utf
25\= Expect no match
26    Ӆ\x0a
27
28/\C(\W?ſ)'?{{/utf
29\= Expect no match
30    \\C(\\W?ſ)'?{{
31
32/X(\C{3})/utf
33    X\x{1234}
34    X\x{11234}Y
35    X\x{11234}YZ
36
37/X(\C{4})/utf
38    X\x{1234}YZ
39    X\x{11234}YZ
40    X\x{11234}YZW
41
42/X\C*/utf
43    XYZabcdce
44
45/X\C*?/utf
46    XYZabcde
47
48/X\C{3,5}/utf
49    Xabcdefg
50    X\x{1234}
51    X\x{1234}YZ
52    X\x{1234}\x{512}
53    X\x{1234}\x{512}YZ
54    X\x{11234}Y
55    X\x{11234}YZ
56    X\x{11234}\x{512}
57    X\x{11234}\x{512}YZ
58    X\x{11234}\x{512}\x{11234}Z
59
60/X\C{3,5}?/utf
61    Xabcdefg
62    X\x{1234}
63    X\x{1234}YZ
64    X\x{1234}\x{512}
65    X\x{11234}Y
66    X\x{11234}YZ
67    X\x{11234}\x{512}YZ
68    X\x{11234}
69
70/a\Cb/utf
71    aXb
72    a\nb
73    a\x{100}b
74
75/a\C\Cb/utf
76    a\x{100}b
77    a\x{12257}b
78    a\x{12257}\x{11234}b
79
80/ab\Cde/utf
81    abXde
82
83# This one is here not because it's different to Perl, but because the way
84# the captured single code unit is displayed. (In Perl it becomes a character,
85# and you can't tell the difference.)
86
87/X(\C)(.*)/utf
88    X\x{1234}
89    X\nabc
90
91# This one is here because Perl gives out a grumbly error message (quite
92# correctly, but that messes up comparisons).
93
94/a\Cb/utf
95\= Expect no match in 8-bit mode
96    a\x{100}b
97
98/^ab\C/utf,no_start_optimize
99\= Expect no match - tests \C at end of subject
100    ab
101
102/\C[^\v]+\x80/utf
103    [AΏBŀC]
104
105/\C[^\d]+\x80/utf
106    [AΏBŀC]
107
108# End of testinput22
109