summaryrefslogtreecommitdiff
path: root/cpan/Unicode-Collate/t/loc_sq.t
blob: 16c8f1cb96cb785edb4ab0ec55b501806375765f (plain)
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

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 => 126 };

use strict;
use warnings;
use Unicode::Collate::Locale;

ok(1);

#########################

my $objSq = Unicode::Collate::Locale->
    new(locale => 'SQ', normalization => undef);

ok($objSq->getlocale, 'sq');

$objSq->change(level => 1);

ok($objSq->lt("c", "c\x{327}"));
ok($objSq->lt("cz","c\x{327}"));
ok($objSq->gt("d", "c\x{327}"));
ok($objSq->lt("d", "dh"));
ok($objSq->lt("dz","dh"));
ok($objSq->gt("e", "dh"));
ok($objSq->lt("e", "e\x{308}"));
ok($objSq->lt("ez","e\x{308}"));
ok($objSq->gt("f", "e\x{308}"));
ok($objSq->lt("g", "gj"));
ok($objSq->lt("gz","gj"));
ok($objSq->gt("h", "gj"));
ok($objSq->lt("l", "ll"));
ok($objSq->lt("lz","ll"));
ok($objSq->gt("m", "ll"));
ok($objSq->lt("n", "nj"));
ok($objSq->lt("nz","nj"));
ok($objSq->gt("o", "nj"));
ok($objSq->lt("r", "rr"));
ok($objSq->lt("rz","rr"));
ok($objSq->gt("s", "rr"));
ok($objSq->lt("s", "sh"));
ok($objSq->lt("sz","sh"));
ok($objSq->gt("t", "sh"));
ok($objSq->lt("t", "th"));
ok($objSq->lt("tz","th"));
ok($objSq->gt("u", "th"));
ok($objSq->lt("x", "xh"));
ok($objSq->lt("xz","xh"));
ok($objSq->gt("y", "xh"));
ok($objSq->lt("z", "zh"));
ok($objSq->lt("zz","zh"));
ok($objSq->lt("zh", "\x{1B7}"));

# 35

$objSq->change(level => 2);

ok($objSq->eq("c\x{327}", "C\x{327}"));
ok($objSq->eq("dh", "dH"));
ok($objSq->eq("dH", "Dh"));
ok($objSq->eq("Dh", "DH"));
ok($objSq->eq("e\x{308}", "E\x{308}"));
ok($objSq->eq("gj", "gJ"));
ok($objSq->eq("gJ", "Gj"));
ok($objSq->eq("Gj", "GJ"));
ok($objSq->eq("ll", "lL"));
ok($objSq->eq("lL", "Ll"));
ok($objSq->eq("Ll", "LL"));
ok($objSq->eq("nj", "nJ"));
ok($objSq->eq("nJ", "Nj"));
ok($objSq->eq("Nj", "NJ"));
ok($objSq->eq("rr", "rR"));
ok($objSq->eq("rR", "Rr"));
ok($objSq->eq("Rr", "RR"));
ok($objSq->eq("sh", "sH"));
ok($objSq->eq("sH", "Sh"));
ok($objSq->eq("Sh", "SH"));
ok($objSq->eq("th", "tH"));
ok($objSq->eq("tH", "Th"));
ok($objSq->eq("Th", "TH"));
ok($objSq->eq("xh", "xH"));
ok($objSq->eq("xH", "Xh"));
ok($objSq->eq("Xh", "XH"));
ok($objSq->eq("zh", "zH"));
ok($objSq->eq("zH", "Zh"));
ok($objSq->eq("Zh", "ZH"));

# 64

$objSq->change(level => 3);

ok($objSq->lt("c\x{327}", "C\x{327}"));
ok($objSq->lt("dh", "dH"));
ok($objSq->lt("dH", "Dh"));
ok($objSq->lt("Dh", "DH"));
ok($objSq->lt("e\x{308}", "E\x{308}"));
ok($objSq->lt("gj", "gJ"));
ok($objSq->lt("gJ", "Gj"));
ok($objSq->lt("Gj", "GJ"));
ok($objSq->lt("ll", "lL"));
ok($objSq->lt("lL", "Ll"));
ok($objSq->lt("Ll", "LL"));
ok($objSq->lt("nj", "nJ"));
ok($objSq->lt("nJ", "Nj"));
ok($objSq->lt("Nj", "NJ"));
ok($objSq->lt("rr", "rR"));
ok($objSq->lt("rR", "Rr"));
ok($objSq->lt("Rr", "RR"));
ok($objSq->lt("sh", "sH"));
ok($objSq->lt("sH", "Sh"));
ok($objSq->lt("Sh", "SH"));
ok($objSq->lt("th", "tH"));
ok($objSq->lt("tH", "Th"));
ok($objSq->lt("Th", "TH"));
ok($objSq->lt("xh", "xH"));
ok($objSq->lt("xH", "Xh"));
ok($objSq->lt("Xh", "XH"));
ok($objSq->lt("zh", "zH"));
ok($objSq->lt("zH", "Zh"));
ok($objSq->lt("Zh", "ZH"));

# 93

ok($objSq->eq("c\x{327}", pack('U', 0xE7)));
ok($objSq->eq("C\x{327}", pack('U', 0xC7)));
ok($objSq->eq("e\x{308}", pack('U', 0xEB)));
ok($objSq->eq("E\x{308}", pack('U', 0xCB)));

# 97

$objSq->change(upper_before_lower => 1);

ok($objSq->gt("c\x{327}", "C\x{327}"));
ok($objSq->gt("dh", "dH"));
ok($objSq->gt("dH", "Dh"));
ok($objSq->gt("Dh", "DH"));
ok($objSq->gt("e\x{308}", "E\x{308}"));
ok($objSq->gt("gj", "gJ"));
ok($objSq->gt("gJ", "Gj"));
ok($objSq->gt("Gj", "GJ"));
ok($objSq->gt("ll", "lL"));
ok($objSq->gt("lL", "Ll"));
ok($objSq->gt("Ll", "LL"));
ok($objSq->gt("nj", "nJ"));
ok($objSq->gt("nJ", "Nj"));
ok($objSq->gt("Nj", "NJ"));
ok($objSq->gt("rr", "rR"));
ok($objSq->gt("rR", "Rr"));
ok($objSq->gt("Rr", "RR"));
ok($objSq->gt("sh", "sH"));
ok($objSq->gt("sH", "Sh"));
ok($objSq->gt("Sh", "SH"));
ok($objSq->gt("th", "tH"));
ok($objSq->gt("tH", "Th"));
ok($objSq->gt("Th", "TH"));
ok($objSq->gt("xh", "xH"));
ok($objSq->gt("xH", "Xh"));
ok($objSq->gt("Xh", "XH"));
ok($objSq->gt("zh", "zH"));
ok($objSq->gt("zH", "Zh"));
ok($objSq->gt("Zh", "ZH"));

# 126