1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
BEGIN {
unless ("A" eq pack('U', 0x41)) {
print "1..0 # Unicode::Collate " .
"cannot stringify a Unicode code point\n";
exit 0;
}
if ($ENV{PERL_CORE}) {
chdir('t') if -d 't';
@INC = $^O eq 'MacOS' ? qw(::lib) : qw(../lib);
}
}
use Test;
BEGIN { plan tests => 217 };
use strict;
use warnings;
use Unicode::Collate::Locale;
ok(1);
#########################
my $objSe = Unicode::Collate::Locale->
new(locale => 'SE', normalization => undef);
my $eth = pack 'U', 0xF0;
my $ETH = pack 'U', 0xD0;
my $thrn = pack 'U', 0xFE;
my $THRN = pack 'U', 0xDE;
my $ae = pack 'U', 0xE6;
my $AE = pack 'U', 0xC6;
ok($objSe->getlocale, 'se');
$objSe->change(level => 1);
ok($objSe->lt("a", "a\x{301}"));
ok($objSe->gt("b", "a\x{301}"));
ok($objSe->lt("c", "c\x{30C}"));
ok($objSe->lt("c\x{30C}", "\x{292}"));
ok($objSe->lt( "\x{292}", "\x{1EF}"));
ok($objSe->gt("d", "\x{1EF}"));
ok($objSe->lt("d", "d\x{335}"));
ok($objSe->gt("e", "d\x{335}"));
ok($objSe->lt("g", "g\x{30C}"));
ok($objSe->lt("g\x{30C}", "\x{1E5}"));
ok($objSe->gt("h", "\x{1E5}"));
ok($objSe->lt("k", "k\x{30C}"));
ok($objSe->gt("l", "k\x{30C}"));
ok($objSe->lt("n", "\x{14B}"));
ok($objSe->gt("o", "\x{14B}"));
ok($objSe->lt("s", "s\x{30C}"));
ok($objSe->gt("t", "s\x{30C}"));
ok($objSe->lt("t", "\x{167}"));
ok($objSe->gt("u", "\x{167}"));
ok($objSe->lt("z", "z\x{30C}"));
ok($objSe->lt("z\x{30C}", "o\x{338}"));
ok($objSe->lt("o\x{338}", $ae));
ok($objSe->lt($ae, "a\x{30A}"));
ok($objSe->lt("a\x{30A}", "a\x{308}"));
ok($objSe->lt("a\x{308}", "o\x{308}"));
ok($objSe->lt("o\x{308}", "\x{1C0}"));
# 28
ok($objSe->eq("d\x{335}", $eth));
ok($objSe->eq( "\x{14B}", "n\x{301}"));
ok($objSe->eq("n\x{301}", "n\x{303}"));
ok($objSe->eq( "\x{167}", $thrn));
ok($objSe->eq("y", "u\x{308}"));
ok($objSe->eq("u\x{308}", "u\x{30B}"));
ok($objSe->eq("o\x{338}", "\x{153}"));
ok($objSe->eq("a\x{30A}", "a\x{307}"));
ok($objSe->eq("a\x{308}", "a\x{303}"));
ok($objSe->eq("o\x{308}", "o\x{30B}"));
ok($objSe->eq("o\x{30B}", "o\x{303}"));
ok($objSe->eq("o\x{303}", "o\x{302}"));
ok($objSe->eq("o\x{302}", "o\x{328}"));
# 41
$objSe->change(level => 2);
ok($objSe->lt("d\x{335}", $eth));
ok($objSe->lt( "\x{14B}", "n\x{301}"));
ok($objSe->lt("n\x{301}", "n\x{303}"));
ok($objSe->lt( "\x{167}", $thrn));
ok($objSe->lt("y", "u\x{308}"));
ok($objSe->lt("u\x{308}", "u\x{30B}"));
ok($objSe->lt("o\x{338}", "\x{153}"));
ok($objSe->lt("a\x{30A}", "a\x{307}"));
ok($objSe->lt("a\x{308}", "a\x{303}"));
ok($objSe->lt("o\x{308}", "o\x{30B}"));
ok($objSe->lt("o\x{30B}", "o\x{303}"));
ok($objSe->lt("o\x{303}", "o\x{302}"));
ok($objSe->lt("o\x{302}", "o\x{328}"));
# 54
ok($objSe->eq("a\x{301}", "A\x{301}"));
ok($objSe->eq("c\x{30C}", "C\x{30C}"));
ok($objSe->eq( "\x{292}", "\x{1B7}"));
ok($objSe->eq( "\x{1EF}", "\x{1EE}"));
ok($objSe->eq("d\x{335}", "D\x{335}"));
ok($objSe->eq($eth, $ETH));
ok($objSe->eq("g\x{30C}", "G\x{30C}"));
ok($objSe->eq( "\x{1E5}", "\x{1E4}"));
ok($objSe->eq("k\x{30C}", "K\x{30C}"));
ok($objSe->eq( "\x{14B}", "\x{14A}"));
ok($objSe->eq("n\x{301}", "N\x{301}"));
ok($objSe->eq("n\x{303}", "N\x{303}"));
ok($objSe->eq("s\x{30C}", "S\x{30C}"));
ok($objSe->eq( "\x{167}", "\x{166}"));
ok($objSe->eq($thrn, $THRN));
ok($objSe->eq("u\x{308}", "U\x{308}"));
ok($objSe->eq("u\x{30B}", "U\x{30B}"));
ok($objSe->eq("z\x{30C}", "Z\x{30C}"));
ok($objSe->eq("o\x{338}", "O\x{338}"));
ok($objSe->eq( "\x{153}", "\x{152}"));
ok($objSe->eq($ae, $AE));
ok($objSe->eq($AE, "\x{1D2D}"));
ok($objSe->eq("a\x{30A}", "A\x{30A}"));
ok($objSe->eq("a\x{307}", "A\x{307}"));
ok($objSe->eq("a\x{308}", "A\x{308}"));
ok($objSe->eq("a\x{303}", "A\x{303}"));
ok($objSe->eq("o\x{308}", "O\x{308}"));
ok($objSe->eq("o\x{30B}", "O\x{30B}"));
ok($objSe->eq("o\x{303}", "O\x{303}"));
ok($objSe->eq("o\x{302}", "O\x{302}"));
ok($objSe->eq("o\x{328}", "O\x{328}"));
# 85
$objSe->change(level => 3);
ok($objSe->lt("a\x{301}", "A\x{301}"));
ok($objSe->lt("c\x{30C}", "C\x{30C}"));
ok($objSe->lt( "\x{292}", "\x{1B7}"));
ok($objSe->lt( "\x{1EF}", "\x{1EE}"));
ok($objSe->lt("d\x{335}", "D\x{335}"));
ok($objSe->lt($eth, $ETH));
ok($objSe->lt("g\x{30C}", "G\x{30C}"));
ok($objSe->lt( "\x{1E5}", "\x{1E4}"));
ok($objSe->lt("k\x{30C}", "K\x{30C}"));
ok($objSe->lt( "\x{14B}", "\x{14A}"));
ok($objSe->lt("n\x{301}", "N\x{301}"));
ok($objSe->lt("n\x{303}", "N\x{303}"));
ok($objSe->lt("s\x{30C}", "S\x{30C}"));
ok($objSe->lt( "\x{167}", "\x{166}"));
ok($objSe->lt($thrn, $THRN));
ok($objSe->lt("u\x{308}", "U\x{308}"));
ok($objSe->lt("u\x{30B}", "U\x{30B}"));
ok($objSe->lt("z\x{30C}", "Z\x{30C}"));
ok($objSe->lt("o\x{338}", "O\x{338}"));
ok($objSe->lt( "\x{153}", "\x{152}"));
ok($objSe->lt($ae, $AE));
ok($objSe->lt($AE, "\x{1D2D}"));
ok($objSe->lt("a\x{30A}", "A\x{30A}"));
ok($objSe->lt("a\x{307}", "A\x{307}"));
ok($objSe->lt("a\x{308}", "A\x{308}"));
ok($objSe->lt("a\x{303}", "A\x{303}"));
ok($objSe->lt("o\x{308}", "O\x{308}"));
ok($objSe->lt("o\x{30B}", "O\x{30B}"));
ok($objSe->lt("o\x{303}", "O\x{303}"));
ok($objSe->lt("o\x{302}", "O\x{302}"));
ok($objSe->lt("o\x{328}", "O\x{328}"));
# 116
ok($objSe->eq("a\x{301}", pack('U', 0xE1)));
ok($objSe->eq("a\x{341}", pack('U', 0xE1)));
ok($objSe->eq("A\x{301}", pack('U', 0xC1)));
ok($objSe->eq("A\x{341}", pack('U', 0xC1)));
ok($objSe->eq("c\x{30C}", "\x{10D}"));
ok($objSe->eq("C\x{30C}", "\x{10C}"));
ok($objSe->eq("\x{1EF}", "\x{292}\x{30C}"));
ok($objSe->eq("\x{1EE}", "\x{1B7}\x{30C}"));
ok($objSe->eq("d\x{335}", "\x{111}"));
ok($objSe->eq("D\x{335}", "\x{110}"));
ok($objSe->eq("g\x{30C}", "\x{1E7}"));
ok($objSe->eq("G\x{30C}", "\x{1E6}"));
ok($objSe->eq("k\x{30C}", "\x{1E9}"));
ok($objSe->eq("K\x{30C}", "\x{1E8}"));
ok($objSe->eq("n\x{301}", "\x{144}"));
ok($objSe->eq("n\x{341}", "\x{144}"));
ok($objSe->eq("N\x{301}", "\x{143}"));
ok($objSe->eq("N\x{341}", "\x{143}"));
ok($objSe->eq("n\x{303}", pack('U', 0xF1)));
ok($objSe->eq("N\x{303}", pack('U', 0xD1)));
ok($objSe->eq("s\x{30C}", "\x{161}"));
ok($objSe->eq("S\x{30C}", "\x{160}"));
ok($objSe->eq("u\x{308}", pack('U', 0xFC)));
ok($objSe->eq("U\x{308}", pack('U', 0xDC)));
ok($objSe->eq("u\x{30B}", "\x{171}"));
ok($objSe->eq("U\x{30B}", "\x{170}"));
# 142
ok($objSe->eq("z\x{30C}", "\x{17E}"));
ok($objSe->eq("Z\x{30C}", "\x{17D}"));
ok($objSe->eq("o\x{338}", pack('U', 0xF8)));
ok($objSe->eq("O\x{338}", pack('U', 0xD8)));
ok($objSe->eq("a\x{30A}", pack('U', 0xE5)));
ok($objSe->eq("A\x{30A}", pack('U', 0xC5)));
ok($objSe->eq("a\x{307}", "\x{227}"));
ok($objSe->eq("A\x{307}", "\x{226}"));
ok($objSe->eq("a\x{308}", pack('U', 0xE4)));
ok($objSe->eq("A\x{308}", pack('U', 0xC4)));
ok($objSe->eq("a\x{303}", pack('U', 0xE3)));
ok($objSe->eq("A\x{303}", pack('U', 0xC3)));
ok($objSe->eq("o\x{308}", pack('U', 0xF6)));
ok($objSe->eq("O\x{308}", pack('U', 0xD6)));
ok($objSe->eq("o\x{30B}", "\x{151}"));
ok($objSe->eq("O\x{30B}", "\x{150}"));
ok($objSe->eq("o\x{303}", pack('U', 0xF5)));
ok($objSe->eq("O\x{303}", pack('U', 0xD5)));
ok($objSe->eq("o\x{302}", pack('U', 0xF4)));
ok($objSe->eq("O\x{302}", pack('U', 0xD4)));
ok($objSe->eq("o\x{328}", "\x{1EB}"));
ok($objSe->eq("O\x{328}", "\x{1EA}"));
# 164
ok($objSe->eq("u\x{308}\x{300}", "\x{1DC}"));
ok($objSe->eq("U\x{308}\x{300}", "\x{1DB}"));
ok($objSe->eq("u\x{308}\x{301}", "\x{1D8}"));
ok($objSe->eq("U\x{308}\x{301}", "\x{1D7}"));
ok($objSe->eq("u\x{308}\x{304}", "\x{1D6}"));
ok($objSe->eq("U\x{308}\x{304}", "\x{1D5}"));
ok($objSe->eq("u\x{308}\x{30C}", "\x{1DA}"));
ok($objSe->eq("U\x{308}\x{30C}", "\x{1D9}"));
ok($objSe->eq("o\x{338}\x{301}", "\x{1FF}"));
ok($objSe->eq("O\x{338}\x{301}", "\x{1FE}"));
ok($objSe->eq("\x{1FD}", "$ae\x{301}"));
ok($objSe->eq("\x{1FC}", "$AE\x{301}"));
ok($objSe->eq("\x{1E3}", "$ae\x{304}"));
ok($objSe->eq("\x{1E2}", "$AE\x{304}"));
ok($objSe->eq("A\x{30A}", "\x{212B}"));
ok($objSe->eq("a\x{30A}\x{301}", "\x{1FB}"));
ok($objSe->eq("A\x{30A}\x{301}", "\x{1FA}"));
ok($objSe->eq("a\x{308}\x{304}", "\x{1DF}"));
ok($objSe->eq("A\x{308}\x{304}", "\x{1DE}"));
ok($objSe->eq("o\x{308}\x{304}", "\x{22B}"));
ok($objSe->eq("O\x{308}\x{304}", "\x{22A}"));
ok($objSe->eq("o\x{303}\x{301}","\x{1E4D}"));
ok($objSe->eq("O\x{303}\x{301}","\x{1E4C}"));
ok($objSe->eq("o\x{303}\x{304}", "\x{22D}"));
ok($objSe->eq("O\x{303}\x{304}", "\x{22C}"));
ok($objSe->eq("o\x{303}\x{308}","\x{1E4F}"));
ok($objSe->eq("O\x{303}\x{308}","\x{1E4E}"));
ok($objSe->eq("o\x{303}\x{31B}","\x{1EE1}"));
ok($objSe->eq("O\x{303}\x{31B}","\x{1EE0}"));
ok($objSe->eq("o\x{302}\x{300}", "\x{1ED3}"));
ok($objSe->eq("O\x{302}\x{300}", "\x{1ED2}"));
ok($objSe->eq("o\x{302}\x{301}", "\x{1ED1}"));
ok($objSe->eq("O\x{302}\x{301}", "\x{1ED0}"));
ok($objSe->eq("o\x{302}\x{303}", "\x{1ED7}"));
ok($objSe->eq("O\x{302}\x{303}", "\x{1ED6}"));
ok($objSe->eq("o\x{302}\x{309}", "\x{1ED5}"));
ok($objSe->eq("O\x{302}\x{309}", "\x{1ED4}"));
ok($objSe->eq("o\x{302}\x{323}", "\x{1ED9}"));
ok($objSe->eq("O\x{302}\x{323}", "\x{1ED8}"));
# 203
$objSe->change(upper_before_lower => 1);
ok($objSe->gt("z\x{30C}", "Z\x{30C}"));
ok($objSe->gt("o\x{338}", "O\x{338}"));
ok($objSe->gt( "\x{153}", "\x{152}"));
ok($objSe->gt($ae, $AE));
ok($objSe->lt($AE, "\x{1D2D}"));
ok($objSe->gt("a\x{30A}", "A\x{30A}"));
ok($objSe->gt("a\x{307}", "A\x{307}"));
ok($objSe->gt("a\x{308}", "A\x{308}"));
ok($objSe->gt("a\x{303}", "A\x{303}"));
ok($objSe->gt("o\x{308}", "O\x{308}"));
ok($objSe->gt("o\x{30B}", "O\x{30B}"));
ok($objSe->gt("o\x{303}", "O\x{303}"));
ok($objSe->gt("o\x{302}", "O\x{302}"));
ok($objSe->gt("o\x{328}", "O\x{328}"));
# 217
|