This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Updated Unicode-Collate to CPAN version 0.76
[perl5.git] / cpan / Unicode-Collate / t / loc_fi.t
CommitLineData
68adb2b0
CBW
1
2BEGIN {
3 unless ("A" eq pack('U', 0x41)) {
4 print "1..0 # Unicode::Collate " .
5 "cannot stringify a Unicode code point\n";
6 exit 0;
7 }
8 if ($ENV{PERL_CORE}) {
9 chdir('t') if -d 't';
10 @INC = $^O eq 'MacOS' ? qw(::lib) : qw(../lib);
11 }
12}
13
14use Test;
19265284 15BEGIN { plan tests => 83 };
68adb2b0 16
64dc7822
CBW
17use strict;
18use warnings;
19use Unicode::Collate::Locale;
20
68adb2b0
CBW
21ok(1);
22
23#########################
64dc7822
CBW
24
25my $uuml = pack 'U', 0xFC;
26my $Uuml = pack 'U', 0xDC;
27my $arng = pack 'U', 0xE5;
28my $Arng = pack 'U', 0xC5;
29my $auml = pack 'U', 0xE4;
30my $Auml = pack 'U', 0xC4;
31my $ae = pack 'U', 0xE6;
32my $AE = pack 'U', 0xC6;
33my $ouml = pack 'U', 0xF6;
34my $Ouml = pack 'U', 0xD6;
35my $ostk = pack 'U', 0xF8;
36my $Ostk = pack 'U', 0xD8;
37
38my $objFi = Unicode::Collate::Locale->
39 new(locale => 'FI', normalization => undef);
40
64dc7822
CBW
41ok($objFi->getlocale, 'fi');
42
43$objFi->change(level => 1);
44
19265284 45ok($objFi->lt('z', $arng));
64dc7822
CBW
46ok($objFi->lt($arng, $auml));
47ok($objFi->lt($auml, $ouml));
19265284 48ok($objFi->lt($ouml, "\x{1C0}"));
64dc7822 49
19265284 50# 6
64dc7822
CBW
51
52ok($objFi->eq("d\x{335}", "\x{111}"));
53ok($objFi->eq("g\x{335}", "\x{1E5}"));
54ok($objFi->eq("n\x{335}", "\x{14B}"));
55ok($objFi->eq("t\x{335}", "\x{167}"));
56ok($objFi->eq("z\x{335}", "\x{292}"));
57ok($objFi->eq('v', 'w'));
58ok($objFi->eq('y', $uuml));
59ok($objFi->eq($auml, $ae));
60ok($objFi->eq($ouml, $ostk));
61
19265284 62# 15
64dc7822
CBW
63
64$objFi->change(level => 2);
65
66ok($objFi->lt("d\x{335}", "\x{111}"));
67ok($objFi->lt("g\x{335}", "\x{1E5}"));
68ok($objFi->lt("n\x{335}", "\x{14B}"));
69ok($objFi->lt("t\x{335}", "\x{167}"));
70ok($objFi->lt("z\x{335}", "\x{292}"));
71ok($objFi->lt('v', 'w'));
72ok($objFi->lt('y', $uuml));
73ok($objFi->lt($auml, $ae));
74ok($objFi->lt($ouml, $ostk));
75
19265284 76# 24
64dc7822
CBW
77
78ok($objFi->eq("\x{111}", "\x{110}"));
79ok($objFi->eq("\x{1E5}", "\x{1E4}"));
80ok($objFi->eq("\x{14B}", "\x{14A}"));
81ok($objFi->eq("\x{167}", "\x{166}"));
82ok($objFi->eq("\x{292}", "\x{1B7}"));
83ok($objFi->eq('w', 'W'));
84ok($objFi->eq($uuml, $Uuml));
85ok($objFi->eq($arng, $Arng));
86ok($objFi->eq($auml, $Auml));
87ok($objFi->eq($ae, $AE));
88ok($objFi->eq($AE, "\x{1D2D}"));
89ok($objFi->eq($ouml, $Ouml));
90ok($objFi->eq($ostk, $Ostk));
91
19265284 92# 37
64dc7822
CBW
93
94$objFi->change(level => 3);
95
96ok($objFi->lt("\x{111}", "\x{110}"));
97ok($objFi->lt("\x{1E5}", "\x{1E4}"));
98ok($objFi->lt("\x{14B}", "\x{14A}"));
99ok($objFi->lt("\x{167}", "\x{166}"));
100ok($objFi->lt("\x{292}", "\x{1B7}"));
101ok($objFi->lt('w', 'W'));
102ok($objFi->lt($uuml, $Uuml));
103ok($objFi->lt($arng, $Arng));
104ok($objFi->lt($auml, $Auml));
105ok($objFi->lt($ae, $AE));
106ok($objFi->lt($AE, "\x{1D2D}"));
107ok($objFi->lt($ouml, $Ouml));
108ok($objFi->lt($ostk, $Ostk));
109
19265284 110# 50
64dc7822
CBW
111
112ok($objFi->eq("u\x{308}", $uuml));
113ok($objFi->eq("U\x{308}", $Uuml));
1393fe00
CBW
114ok($objFi->eq("\x{1EF}", "\x{292}\x{30C}"));
115ok($objFi->eq("\x{1EE}", "\x{1B7}\x{30C}"));
116ok($objFi->eq("a\x{30A}", $arng));
117ok($objFi->eq("A\x{30A}", $Arng));
118ok($objFi->eq("a\x{308}", $auml));
119ok($objFi->eq("A\x{308}", $Auml));
120ok($objFi->eq("o\x{308}", $ouml));
121ok($objFi->eq("O\x{308}", $Ouml));
122ok($objFi->eq("o\x{338}", $ostk));
123ok($objFi->eq("O\x{338}", $Ostk));
124
19265284 125# 62
1393fe00 126
f1a7422f
CBW
127ok($objFi->eq("u\x{308}\x{300}", "\x{1DC}"));
128ok($objFi->eq("U\x{308}\x{300}", "\x{1DB}"));
129ok($objFi->eq("u\x{308}\x{301}", "\x{1D8}"));
130ok($objFi->eq("U\x{308}\x{301}", "\x{1D7}"));
131ok($objFi->eq("u\x{308}\x{304}", "\x{1D6}"));
132ok($objFi->eq("U\x{308}\x{304}", "\x{1D5}"));
133ok($objFi->eq("u\x{308}\x{30C}", "\x{1DA}"));
134ok($objFi->eq("U\x{308}\x{30C}", "\x{1D9}"));
64dc7822
CBW
135ok($objFi->eq("A\x{30A}", "\x{212B}"));
136ok($objFi->eq("a\x{30A}\x{301}", "\x{1FB}"));
137ok($objFi->eq("A\x{30A}\x{301}", "\x{1FA}"));
f1a7422f
CBW
138ok($objFi->eq("a\x{308}\x{304}", "\x{1DF}"));
139ok($objFi->eq("A\x{308}\x{304}", "\x{1DE}"));
64dc7822
CBW
140ok($objFi->eq("\x{1FD}", "$ae\x{301}"));
141ok($objFi->eq("\x{1FC}", "$AE\x{301}"));
142ok($objFi->eq("\x{1E3}", "$ae\x{304}"));
143ok($objFi->eq("\x{1E2}", "$AE\x{304}"));
f1a7422f
CBW
144ok($objFi->eq("o\x{308}\x{304}", "\x{22B}"));
145ok($objFi->eq("O\x{308}\x{304}", "\x{22A}"));
64dc7822
CBW
146ok($objFi->eq("o\x{338}\x{301}", "\x{1FF}"));
147ok($objFi->eq("O\x{338}\x{301}", "\x{1FE}"));
148
19265284 149# 83