This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/anyof.t: Add capability to utf8::upgrade()
[perl5.git] / t / re / anyof.t
CommitLineData
1ce8be81
N
1#!./perl
2
671d6967
KW
3use strict;
4use warnings;
847612ec
KW
5use utf8;
6
7# This tests that the ANYOF nodes generated by bracketed character classes are
8# as expected. The representation of these is not guaranteed, and this test
9# may need to be updated if it changes. But it is here to make sure that no
10# unexpected changes occur. These could come from faulty generation of the
11# node, or faulty display of them (or both). Because these causes come from
12# very different parts of the regex compiler, it is unlikely that a commit
13# would change both of them, so this test will adequately serve to test both.
14
15BEGIN {
16 chdir 't' if -d 't';
847612ec 17 require './test.pl';
1ce8be81
N
18 set_up_inc('../lib','.','../ext/re');
19 require Config; import Config;
847612ec
KW
20 skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader;
21}
22
23# An array is used instead of a hash, so that the tests are carried out in the
24# order given by this file. Even-numbered indices are the regexes to compile.
25# The next higher element is the expected compilation result.
26#
27# It is painful to port some of these to EBCDIC, as not only do the code point
28# numbers change (for those < 256), but the order changes, as the compiled
29# version is sorted by native code point order. On EBCDIC, \r comes before
30# \n, and 'k' before "K', for example. So, the tests where there are
31# differences are skipped on EBCDIC. They are all at the beginning of the
32# array, and a special marker entry is used to delmit the boundary between
33# skipped and not skipped.
87cafc45
KW
34#
35# NOTE: If the pattern contains (?8) it will be upgraded to UTF-8 after
36# stripping that
847612ec
KW
37
38my @tests = (
2813d4ad 39 '[[{]' => 'ANYOFM[\[\{]',
02517e3f 40 '[^\S ]' => 'ANYOFD[\t\n\x0B\f\r{utf8}\x85\xA0][1680 2000-200A 2028-2029 202F 205F 3000]',
6b503dfb
KW
41 '[^\n\r]' => 'ANYOF[^\n\r][0100-INFTY]',
42 '[^\/\|,\$\%%\@\ \%"\<\>\:\#\&\*\{\}\[\]\(\)]' => 'ANYOF[^ "#$%&()*,/:<>@\[\]\{|\}][0100-INFTY]',
a3049f27 43 '[^[:^print:][:^ascii:]]' => 'POSIXA[:print:]',
847612ec 44 '[ [:blank:]]' => 'ANYOFD[\t {utf8}\xA0][1680 2000-200A 202F 205F 3000]',
6b503dfb
KW
45 '[_[:^blank:]]' => 'ANYOFD[^\t {utf8}\xA0][0100-167F 1681-1FFF 200B-202E 2030-205E 2060-2FFF 3001-INFTY]',
46 '[\xA0[:^blank:]]' => 'ANYOF[^\t ][0100-167F 1681-1FFF 200B-202E 2030-205E 2060-2FFF 3001-INFTY]',
d555b9dd 47 '[ [:blank:]]' => 'ANYOFD[\t {utf8}\xA0][1680 2000-200A 202F 205F 3000]',
6b503dfb 48 '[_[:^blank:]]' => 'ANYOFD[^\t {utf8}\xA0][0100-167F 1681-1FFF 200B-202E 2030-205E 2060-2FFF 3001-INFTY]',
6b503dfb 49 '(?d:[_[:^blank:]])' => 'ANYOFD[^\t {utf8}\xA0][0100-167F 1681-1FFF 200B-202E 2030-205E 2060-2FFF 3001-INFTY]',
58f79e73 50 '[\x{07}-\x{0B}]' => 'ANYOF[\a\b\t\n\x0B]',
847612ec
KW
51 '(?il:[\x{212A}])' => 'ANYOFL{i}[{utf8 locale}Kk][212A]',
52 '(?il:(?[\x{212A}]))' => 'ANYOFL{utf8-locale-reqd}[Kk][212A]',
53
54 'ebcdic_ok_below_this_marker',
55
56 '(?l:[\x{212A}])' => 'ANYOFL[212A]',
d156f5cb
KW
57 '(?l:[\s\x{212A}])' => 'ANYOFPOSIXL[\s][1680 2000-200A 2028-2029 202F 205F 212A 3000]',
58 '(?l:[^\S\x{202F}])' => 'ANYOFPOSIXL[^\\S][1680 2000-200A 2028-2029 205F 3000]',
3db0bccc 59 '(?i:[^:])' => 'NANYOFM[:]',
ecfe5375
KW
60 '[\p{Any}]' => 'ANYOF[\x00-\xFF][0100-10FFFF]',
61 '[\p{IsMyRuntimeProperty}]' => 'ANYOF[+utf8::IsMyRuntimeProperty]',
62 '[^\p{IsMyRuntimeProperty}]' => 'ANYOF[^{+utf8::IsMyRuntimeProperty}]',
63 '[a\p{IsMyRuntimeProperty}]' => 'ANYOF[a][+utf8::IsMyRuntimeProperty]',
64 '[^a\p{IsMyRuntimeProperty}]' => 'ANYOF[^a{+utf8::IsMyRuntimeProperty}]',
65 '[^a\x{100}\p{IsMyRuntimeProperty}]' => 'ANYOF[^a{+utf8::IsMyRuntimeProperty}0100]',
6b503dfb
KW
66 '[{INFTY_minus_1}]' => 'ANYOF[INFTY_minus_1]',
67 '[{INFTY}]' => 'ANYOF[INFTY-INFTY]',
a7560fcd
KW
68 '[\x{102}\x{104}]' => 'ANYOF[0102 0104]',
69 '[\x{104}\x{102}]' => 'ANYOF[0102 0104]',
70 '[\x{103}\x{102}]' => 'ANYOF[0102-0103]',
6b503dfb
KW
71 '[\x{00}-{INFTY_minus_1}]' => 'ANYOF[\x00-\xFF][0100-INFTY_minus_1]',
72 '[\x{00}-{INFTY}]' => 'SANY',
73 '[\x{101}-{INFTY_minus_1}]' => 'ANYOF[0101-INFTY_minus_1]',
74 '[\x{101}-{INFTY}]' => 'ANYOF[0101-INFTY]',
a7560fcd
KW
75 '[\x{104}\x{102}\x{103}]' => 'ANYOF[0102-0104]',
76 '[\x{102}-\x{104}\x{101}]' => 'ANYOF[0101-0104]',
77 '[\x{102}-\x{104}\x{102}]' => 'ANYOF[0102-0104]',
78 '[\x{102}-\x{104}\x{103}]' => 'ANYOF[0102-0104]',
79 '[\x{102}-\x{104}\x{104}]' => 'ANYOF[0102-0104]',
80 '[\x{102}-\x{104}\x{105}]' => 'ANYOF[0102-0105]',
81 '[\x{102}-\x{104}\x{106}]' => 'ANYOF[0102-0104 0106]',
6b503dfb
KW
82 '[\x{102}-\x{104}{INFTY_minus_1}]' => 'ANYOF[0102-0104 INFTY_minus_1]',
83 '[\x{102}-\x{104}{INFTY}]' => 'ANYOF[0102-0104 INFTY-INFTY]',
84 '[\x{102}-\x{104}\x{101}-{INFTY_minus_1}]' => 'ANYOF[0101-INFTY_minus_1]',
85 '[\x{102}-\x{104}\x{101}-{INFTY}]' => 'ANYOF[0101-INFTY]',
86 '[\x{102}-\x{104}\x{102}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
87 '[\x{102}-\x{104}\x{102}-{INFTY}]' => 'ANYOF[0102-INFTY]',
88 '[\x{102}-\x{104}\x{103}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
89 '[\x{102}-\x{104}\x{103}-{INFTY}]' => 'ANYOF[0102-INFTY]',
90 '[\x{102}-\x{104}\x{104}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
91 '[\x{102}-\x{104}\x{104}-{INFTY}]' => 'ANYOF[0102-INFTY]',
92 '[\x{102}-\x{104}\x{105}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
93 '[\x{102}-\x{104}\x{105}-{INFTY}]' => 'ANYOF[0102-INFTY]',
94 '[\x{102}-\x{104}\x{106}-{INFTY_minus_1}]' => 'ANYOF[0102-0104 0106-INFTY_minus_1]',
95 '[\x{102}-\x{104}\x{106}-{INFTY}]' => 'ANYOF[0102-0104 0106-INFTY]',
a7560fcd
KW
96 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}]' => 'ANYOF[0101-0104 0108-010A]',
97 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}]' => 'ANYOF[0102-0104 0108-010A]',
98 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}]' => 'ANYOF[0102-0104 0108-010A]',
99 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}]' => 'ANYOF[0102-0104 0108-010A]',
100 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}]' => 'ANYOF[0102-0105 0108-010A]',
101 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}]' => 'ANYOF[0102-0104 0106 0108-010A]',
102 '[\x{102}-\x{104}\x{108}-\x{10A}\x{107}]' => 'ANYOF[0102-0104 0107-010A]',
103 '[\x{102}-\x{104}\x{108}-\x{10A}\x{108}]' => 'ANYOF[0102-0104 0108-010A]',
104 '[\x{102}-\x{104}\x{108}-\x{10A}\x{109}]' => 'ANYOF[0102-0104 0108-010A]',
105 '[\x{102}-\x{104}\x{108}-\x{10A}\x{10A}]' => 'ANYOF[0102-0104 0108-010A]',
106 '[\x{102}-\x{104}\x{108}-\x{10A}\x{10B}]' => 'ANYOF[0102-0104 0108-010B]',
6b503dfb
KW
107 '[\x{102}-\x{104}\x{108}-\x{10A}{INFTY_minus_1}]' => 'ANYOF[0102-0104 0108-010A INFTY_minus_1]',
108 '[\x{102}-\x{104}\x{108}-\x{10A}{INFTY}]' => 'ANYOF[0102-0104 0108-010A INFTY-INFTY]',
a7560fcd
KW
109 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{102}]' => 'ANYOF[0101-0104 0108-010A]',
110 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{103}]' => 'ANYOF[0101-0104 0108-010A]',
111 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{104}]' => 'ANYOF[0101-0104 0108-010A]',
112 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{105}]' => 'ANYOF[0101-0105 0108-010A]',
113 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{106}]' => 'ANYOF[0101-0106 0108-010A]',
114 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{107}]' => 'ANYOF[0101-010A]',
115 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{108}]' => 'ANYOF[0101-010A]',
116 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{109}]' => 'ANYOF[0101-010A]',
117 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{10A}]' => 'ANYOF[0101-010A]',
118 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{10B}]' => 'ANYOF[0101-010B]',
6b503dfb
KW
119 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-{INFTY_minus_1}]' => 'ANYOF[0101-INFTY_minus_1]',
120 '[\x{102}-\x{104}\x{108}-\x{10A}\x{101}-{INFTY}]' => 'ANYOF[0101-INFTY]',
a7560fcd
KW
121 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{102}]' => 'ANYOF[0102-0104 0108-010A]',
122 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{103}]' => 'ANYOF[0102-0104 0108-010A]',
123 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{104}]' => 'ANYOF[0102-0104 0108-010A]',
124 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{105}]' => 'ANYOF[0102-0105 0108-010A]',
125 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{106}]' => 'ANYOF[0102-0106 0108-010A]',
126 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{107}]' => 'ANYOF[0102-010A]',
127 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{108}]' => 'ANYOF[0102-010A]',
128 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{109}]' => 'ANYOF[0102-010A]',
129 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{10A}]' => 'ANYOF[0102-010A]',
130 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{10B}]' => 'ANYOF[0102-010B]',
131 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{10C}]' => 'ANYOF[0102-010C]',
6b503dfb
KW
132 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
133 '[\x{102}-\x{104}\x{108}-\x{10A}\x{102}-{INFTY}]' => 'ANYOF[0102-INFTY]',
a7560fcd
KW
134 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}]' => 'ANYOF[0102-0104 0108-010A]',
135 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{104}]' => 'ANYOF[0102-0104 0108-010A]',
136 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{105}]' => 'ANYOF[0102-0105 0108-010A]',
137 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{106}]' => 'ANYOF[0102-0106 0108-010A]',
138 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{107}]' => 'ANYOF[0102-010A]',
139 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{108}]' => 'ANYOF[0102-010A]',
140 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{109}]' => 'ANYOF[0102-010A]',
141 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{10A}]' => 'ANYOF[0102-010A]',
142 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{10B}]' => 'ANYOF[0102-010B]',
143 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{10C}]' => 'ANYOF[0102-010C]',
6b503dfb
KW
144 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
145 '[\x{102}-\x{104}\x{108}-\x{10A}\x{103}-{INFTY}]' => 'ANYOF[0102-INFTY]',
a7560fcd
KW
146 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}]' => 'ANYOF[0102-0104 0108-010A]',
147 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{105}]' => 'ANYOF[0102-0105 0108-010A]',
148 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{106}]' => 'ANYOF[0102-0106 0108-010A]',
149 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{107}]' => 'ANYOF[0102-010A]',
150 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{108}]' => 'ANYOF[0102-010A]',
151 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{109}]' => 'ANYOF[0102-010A]',
152 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{10A}]' => 'ANYOF[0102-010A]',
153 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{10B}]' => 'ANYOF[0102-010B]',
154 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{10C}]' => 'ANYOF[0102-010C]',
6b503dfb
KW
155 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
156 '[\x{102}-\x{104}\x{108}-\x{10A}\x{104}-{INFTY}]' => 'ANYOF[0102-INFTY]',
a7560fcd
KW
157 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}]' => 'ANYOF[0102-0105 0108-010A]',
158 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{106}]' => 'ANYOF[0102-0106 0108-010A]',
159 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{107}]' => 'ANYOF[0102-010A]',
160 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{108}]' => 'ANYOF[0102-010A]',
161 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{109}]' => 'ANYOF[0102-010A]',
162 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{10A}]' => 'ANYOF[0102-010A]',
163 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{10B}]' => 'ANYOF[0102-010B]',
164 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{10C}]' => 'ANYOF[0102-010C]',
6b503dfb
KW
165 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY_minus_1]',
166 '[\x{102}-\x{104}\x{108}-\x{10A}\x{105}-{INFTY}]' => 'ANYOF[0102-INFTY]',
a7560fcd
KW
167 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}]' => 'ANYOF[0102-0104 0106 0108-010A]',
168 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{107}]' => 'ANYOF[0102-0104 0106-010A]',
169 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{108}]' => 'ANYOF[0102-0104 0106-010A]',
170 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{109}]' => 'ANYOF[0102-0104 0106-010A]',
171 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{10A}]' => 'ANYOF[0102-0104 0106-010A]',
172 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{10B}]' => 'ANYOF[0102-0104 0106-010B]',
173 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{10C}]' => 'ANYOF[0102-0104 0106-010C]',
6b503dfb
KW
174 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-{INFTY_minus_1}]' => 'ANYOF[0102-0104 0106-INFTY_minus_1]',
175 '[\x{102}-\x{104}\x{108}-\x{10A}\x{106}-{INFTY}]' => 'ANYOF[0102-0104 0106-INFTY]',
176 '[\x{10C}-{INFTY}{INFTY_minus_1}]' => 'ANYOF[010C-INFTY]',
177 '[\x{10C}-{INFTY}{INFTY}]' => 'ANYOF[010C-INFTY]',
178 '[\x{10C}-{INFTY}\x{102}\x{104}]' => 'ANYOF[0102 0104 010C-INFTY]',
179 '[\x{10C}-{INFTY}\x{104}\x{102}]' => 'ANYOF[0102 0104 010C-INFTY]',
180 '[\x{10C}-{INFTY}\x{103}\x{102}]' => 'ANYOF[0102-0103 010C-INFTY]',
181 '[\x{10C}-{INFTY}\x{00}-{INFTY_minus_1}]' => 'SANY',
182 '[\x{10C}-{INFTY}\x{00}-{INFTY}]' => 'SANY',
183 '[\x{10C}-{INFTY}\x{101}-{INFTY_minus_1}]' => 'ANYOF[0101-INFTY]',
184 '[\x{10C}-{INFTY}\x{101}-{INFTY}]' => 'ANYOF[0101-INFTY]',
185 '[\x{10C}-{INFTY}\x{104}\x{102}\x{103}]' => 'ANYOF[0102-0104 010C-INFTY]',
186 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{101}]' => 'ANYOF[0101-0104 010C-INFTY]',
187 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{102}]' => 'ANYOF[0102-0104 010C-INFTY]',
188 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{103}]' => 'ANYOF[0102-0104 010C-INFTY]',
189 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{104}]' => 'ANYOF[0102-0104 010C-INFTY]',
190 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{105}]' => 'ANYOF[0102-0105 010C-INFTY]',
191 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{106}]' => 'ANYOF[0102-0104 0106 010C-INFTY]',
192 '[\x{10C}-{INFTY}\x{102}-\x{104}{INFTY_minus_1}]' => 'ANYOF[0102-0104 010C-INFTY]',
193 '[\x{10C}-{INFTY}\x{102}-\x{104}{INFTY}]' => 'ANYOF[0102-0104 010C-INFTY]',
194 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{101}-{INFTY_minus_1}]' => 'ANYOF[0101-INFTY]',
195 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{101}-{INFTY}]' => 'ANYOF[0101-INFTY]',
196 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{102}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
197 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{102}-{INFTY}]' => 'ANYOF[0102-INFTY]',
198 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{103}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
199 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{103}-{INFTY}]' => 'ANYOF[0102-INFTY]',
200 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{104}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
201 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{104}-{INFTY}]' => 'ANYOF[0102-INFTY]',
202 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{105}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
203 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{105}-{INFTY}]' => 'ANYOF[0102-INFTY]',
204 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{106}-{INFTY_minus_1}]' => 'ANYOF[0102-0104 0106-INFTY]',
205 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{106}-{INFTY}]' => 'ANYOF[0102-0104 0106-INFTY]',
206 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}]' => 'ANYOF[0101-0104 0108-010A 010C-INFTY]',
207 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
208 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
209 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
210 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}]' => 'ANYOF[0102-0105 0108-010A 010C-INFTY]',
211 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}]' => 'ANYOF[0102-0104 0106 0108-010A 010C-INFTY]',
212 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{107}]' => 'ANYOF[0102-0104 0107-010A 010C-INFTY]',
213 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{108}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
214 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{109}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
215 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{10A}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
216 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{10B}]' => 'ANYOF[0102-0104 0108-INFTY]',
217 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}{INFTY_minus_1}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
218 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}{INFTY}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
219 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{102}]' => 'ANYOF[0101-0104 0108-010A 010C-INFTY]',
220 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{103}]' => 'ANYOF[0101-0104 0108-010A 010C-INFTY]',
221 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{104}]' => 'ANYOF[0101-0104 0108-010A 010C-INFTY]',
222 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{105}]' => 'ANYOF[0101-0105 0108-010A 010C-INFTY]',
223 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{106}]' => 'ANYOF[0101-0106 0108-010A 010C-INFTY]',
224 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{107}]' => 'ANYOF[0101-010A 010C-INFTY]',
225 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{108}]' => 'ANYOF[0101-010A 010C-INFTY]',
226 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{109}]' => 'ANYOF[0101-010A 010C-INFTY]',
227 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{10A}]' => 'ANYOF[0101-010A 010C-INFTY]',
228 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-\x{10B}]' => 'ANYOF[0101-INFTY]',
229 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-{INFTY_minus_1}]' => 'ANYOF[0101-INFTY]',
230 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{101}-{INFTY}]' => 'ANYOF[0101-INFTY]',
231 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{102}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
232 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{103}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
233 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{104}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
234 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{105}]' => 'ANYOF[0102-0105 0108-010A 010C-INFTY]',
235 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{106}]' => 'ANYOF[0102-0106 0108-010A 010C-INFTY]',
236 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{107}]' => 'ANYOF[0102-010A 010C-INFTY]',
237 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{108}]' => 'ANYOF[0102-010A 010C-INFTY]',
238 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{109}]' => 'ANYOF[0102-010A 010C-INFTY]',
239 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{10A}]' => 'ANYOF[0102-010A 010C-INFTY]',
240 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{10B}]' => 'ANYOF[0102-INFTY]',
241 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-\x{10C}]' => 'ANYOF[0102-INFTY]',
242 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
243 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{102}-{INFTY}]' => 'ANYOF[0102-INFTY]',
244 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
245 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{104}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
246 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{105}]' => 'ANYOF[0102-0105 0108-010A 010C-INFTY]',
247 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{106}]' => 'ANYOF[0102-0106 0108-010A 010C-INFTY]',
248 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{107}]' => 'ANYOF[0102-010A 010C-INFTY]',
249 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{108}]' => 'ANYOF[0102-010A 010C-INFTY]',
250 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{109}]' => 'ANYOF[0102-010A 010C-INFTY]',
251 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{10A}]' => 'ANYOF[0102-010A 010C-INFTY]',
252 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{10B}]' => 'ANYOF[0102-INFTY]',
253 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-\x{10C}]' => 'ANYOF[0102-INFTY]',
254 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
255 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{103}-{INFTY}]' => 'ANYOF[0102-INFTY]',
256 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}]' => 'ANYOF[0102-0104 0108-010A 010C-INFTY]',
257 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{105}]' => 'ANYOF[0102-0105 0108-010A 010C-INFTY]',
258 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{106}]' => 'ANYOF[0102-0106 0108-010A 010C-INFTY]',
259 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{107}]' => 'ANYOF[0102-010A 010C-INFTY]',
260 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{108}]' => 'ANYOF[0102-010A 010C-INFTY]',
261 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{109}]' => 'ANYOF[0102-010A 010C-INFTY]',
262 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{10A}]' => 'ANYOF[0102-010A 010C-INFTY]',
263 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{10B}]' => 'ANYOF[0102-INFTY]',
264 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-\x{10C}]' => 'ANYOF[0102-INFTY]',
265 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
266 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{104}-{INFTY}]' => 'ANYOF[0102-INFTY]',
267 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}]' => 'ANYOF[0102-0105 0108-010A 010C-INFTY]',
268 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{106}]' => 'ANYOF[0102-0106 0108-010A 010C-INFTY]',
269 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{107}]' => 'ANYOF[0102-010A 010C-INFTY]',
270 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{108}]' => 'ANYOF[0102-010A 010C-INFTY]',
271 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{109}]' => 'ANYOF[0102-010A 010C-INFTY]',
272 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{10A}]' => 'ANYOF[0102-010A 010C-INFTY]',
273 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{10B}]' => 'ANYOF[0102-INFTY]',
274 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-\x{10C}]' => 'ANYOF[0102-INFTY]',
275 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-{INFTY_minus_1}]' => 'ANYOF[0102-INFTY]',
276 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{105}-{INFTY}]' => 'ANYOF[0102-INFTY]',
277 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}]' => 'ANYOF[0102-0104 0106 0108-010A 010C-INFTY]',
278 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{107}]' => 'ANYOF[0102-0104 0106-010A 010C-INFTY]',
279 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{108}]' => 'ANYOF[0102-0104 0106-010A 010C-INFTY]',
280 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{109}]' => 'ANYOF[0102-0104 0106-010A 010C-INFTY]',
281 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{10A}]' => 'ANYOF[0102-0104 0106-010A 010C-INFTY]',
282 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{10B}]' => 'ANYOF[0102-0104 0106-INFTY]',
283 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-\x{10C}]' => 'ANYOF[0102-0104 0106-INFTY]',
284 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-{INFTY_minus_1}]' => 'ANYOF[0102-0104 0106-INFTY]',
285 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{108}-\x{10A}\x{106}-{INFTY}]' => 'ANYOF[0102-0104 0106-INFTY]',
286 '[\x{106}-{INFTY}\x{104}]' => 'ANYOF[0104 0106-INFTY]',
287 '[\x{106}-{INFTY}\x{105}]' => 'ANYOF[0105-INFTY]',
288 '[\x{106}-{INFTY}\x{106}]' => 'ANYOF[0106-INFTY]',
289 '[\x{106}-{INFTY}\x{107}]' => 'ANYOF[0106-INFTY]',
290 '[\x{106}-{INFTY}\x{104}-\x{105}]' => 'ANYOF[0104-INFTY]',
291 '[\x{106}-{INFTY}\x{104}-\x{106}]' => 'ANYOF[0104-INFTY]',
292 '[\x{106}-{INFTY}\x{104}-\x{107}]' => 'ANYOF[0104-INFTY]',
293 '[\x{106}-{INFTY}\x{104}-{INFTY_minus_1}]' => 'ANYOF[0104-INFTY]',
294 '[\x{106}-{INFTY}\x{104}-{INFTY}]' => 'ANYOF[0104-INFTY]',
295 '[\x{106}-{INFTY}\x{105}-\x{106}]' => 'ANYOF[0105-INFTY]',
296 '[\x{106}-{INFTY}\x{105}-\x{107}]' => 'ANYOF[0105-INFTY]',
297 '[\x{106}-{INFTY}\x{105}-{INFTY_minus_1}]' => 'ANYOF[0105-INFTY]',
298 '[\x{106}-{INFTY}\x{105}-{INFTY}]' => 'ANYOF[0105-INFTY]',
299 '[\x{106}-{INFTY}\x{106}-\x{107}]' => 'ANYOF[0106-INFTY]',
300 '[\x{106}-{INFTY}\x{106}-{INFTY_minus_1}]' => 'ANYOF[0106-INFTY]',
301 '[\x{106}-{INFTY}\x{106}-{INFTY}]' => 'ANYOF[0106-INFTY]',
302 '[\x{106}-{INFTY}\x{107}-\x{107}]' => 'ANYOF[0106-INFTY]',
303 '[\x{106}-{INFTY}\x{107}-{INFTY_minus_1}]' => 'ANYOF[0106-INFTY]',
304 '[\x{106}-{INFTY}\x{107}-{INFTY}]' => 'ANYOF[0106-INFTY]',
305 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{100}]' => 'ANYOF[0100 0102-0104 010C-INFTY]',
306 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{101}]' => 'ANYOF[0101-0104 010C-INFTY]',
307 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{102}]' => 'ANYOF[0102-0104 010C-INFTY]',
308 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{103}]' => 'ANYOF[0102-0104 010C-INFTY]',
309 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{104}]' => 'ANYOF[0102-0104 010C-INFTY]',
310 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{105}]' => 'ANYOF[0102-0105 010C-INFTY]',
311 '[\x{10C}-{INFTY}\x{102}-\x{104}\x{106}]' => 'ANYOF[0102-0104 0106 010C-INFTY]',
847612ec
KW
312);
313
314# 2**32-1 or 2**64-1
315my $highest_cp_string = "F" x (($Config{uvsize} < 8) ? 8 : 16);
316
317my $next_highest_cp_string = $highest_cp_string =~ s/ F $ /E/xr;
318
319my $highest_cp = "\\x{$highest_cp_string}";
320my $next_highest_cp = "\\x{$next_highest_cp_string}";
321
322plan(scalar (@tests - 1) / 2); # -1 because of the marker.
323
324my $skip_ebcdic = $::IS_EBCDIC;
325while (defined (my $test = shift @tests)) {
326
327 if ($test eq 'ebcdic_ok_below_this_marker') {
328 $skip_ebcdic = 0;
329 next;
330 }
331
332 my $expected = shift @tests;
333
334 SKIP: {
335 skip("test not ported to EBCDIC", 1) if $skip_ebcdic;
336
337 my $display_expected = $expected
6b503dfb 338 =~ s/ INFTY_minus_1 /$next_highest_cp/xgr;
847612ec
KW
339
340 # Convert platform-independent values to what is suitable for the
341 # platform
6b503dfb
KW
342 $test =~ s/\{INFTY\}/$highest_cp/g;
343 $test =~ s/\{INFTY_minus_1\}/$next_highest_cp/g;
87cafc45 344 my $use_utf8 = ($test =~ s/\Q(?8)//);
847612ec 345
87cafc45
KW
346 $test = "my \$a = '$test';";
347 $test .= "utf8::upgrade(\$a);" if $use_utf8;
348 $test .= "qr/\$a/";
847612ec
KW
349 my $actual_test = "use re qw(Debug COMPILE); $test";
350
351 my $result = fresh_perl($actual_test);
352 if ($? != 0) { # Re-run so as to display STDERR.
353 fail($test);
354 fresh_perl($actual_test, { stderr => 0, verbose => 1 });
355 next;
356 }
357
358 # The Debug output will come back as a bunch of lines. We are
359 # interested only in the line after /Final program/
360 my @lines = split /\n/, $result;
361 while (defined ($_ = shift @lines)) {
362 next unless /Final program/;
363 $_ = shift @lines;
364
365 s/ \s* \( \d+ \) \s* //x; # Get rid of the node branch
366 s/ ^ \s* \d+ : \s* //x; # ... And the node number
367
368 # Use platform-independent values
6b503dfb
KW
369 s/$highest_cp_string/INFTY/g;
370 s/$next_highest_cp_string/INFTY_minus_1/g;
847612ec
KW
371
372 is($_, $expected,
373 "Verify compilation of $test displays as $display_expected");
374 last; # Discard the rest of this test's output
375 }
376 }
377}