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
|
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 => 41 };
use strict;
use warnings;
use Unicode::Collate::Locale;
ok(1);
#########################
my $objPa = Unicode::Collate::Locale->
new(locale => 'PA', normalization => undef);
my $default = Unicode::Collate::Locale->
new(normalization => undef);
ok($objPa->getlocale, 'pa');
ok($default->getlocale, 'default');
$objPa->change(level => 1);
ok($objPa->lt("\x{A5C}", "\x{A4D}"));
ok($objPa->lt("\x{A4D}", "\x{A3E}"));
# 5
# RRA and Vowel Signs
for my $o ($objPa, $default) {
ok($o->lt("\x{A5C}", "\x{A3E}"));
ok($o->lt("\x{A3E}", "\x{A3F}"));
ok($o->lt("\x{A3F}", "\x{A40}"));
ok($o->lt("\x{A40}", "\x{A41}"));
ok($o->lt("\x{A41}", "\x{A42}"));
ok($o->lt("\x{A42}", "\x{A47}"));
ok($o->lt("\x{A47}", "\x{A48}"));
ok($o->lt("\x{A48}", "\x{A4B}"));
ok($o->lt("\x{A4B}", "\x{A4C}"));
}
# 23
ok($default->lt("\x{A4C}", "\x{A4D}"));
# 24
ok($objPa->eq("\x{A03}", ""));
ok($objPa->eq("\x{A03}", "\x{A71}"));
ok($objPa->eq("\x{A71}", "\x{A70}"));
ok($objPa->eq("\x{A70}", "\x{A02}"));
ok($objPa->eq("\x{A02}", "\x{A01}"));
ok($objPa->eq("\x{A01}", "\x{A3C}"));
# 30
$objPa->change(level => 2);
ok($objPa->lt("\x{A03}", "\x{A71}"));
ok($objPa->lt("\x{A71}", "\x{A70}"));
ok($objPa->lt("\x{A70}", "\x{A02}"));
ok($objPa->lt("\x{A02}", "\x{A01}"));
ok($objPa->lt("\x{A01}", "\x{A3C}"));
# 35
$objPa->change(level => 3);
ok($objPa->eq("\x{A33}", "\x{A32}\x{A3C}"));
ok($objPa->eq("\x{A36}", "\x{A38}\x{A3C}"));
ok($objPa->eq("\x{A59}", "\x{A16}\x{A3C}"));
ok($objPa->eq("\x{A5A}", "\x{A17}\x{A3C}"));
ok($objPa->eq("\x{A5B}", "\x{A1C}\x{A3C}"));
ok($objPa->eq("\x{A5E}", "\x{A2B}\x{A3C}"));
# 41
|