summaryrefslogtreecommitdiff
path: root/cpan/Unicode-Collate/t/loc_sw.t
blob: 1805c1b497e30ff8c7334b78115cadff49b8df32 (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

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

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

ok(1);

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

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

ok($objSw->getlocale, 'sw');

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

ok($objSw->lt("b", "ch"));
ok($objSw->lt("bz","ch"));
ok($objSw->gt("c", "ch"));
ok($objSw->lt("d", "dh"));
ok($objSw->lt("dz","dh"));
ok($objSw->gt("e", "dh"));
ok($objSw->lt("g", "gh"));
ok($objSw->lt("gz","gh"));
ok($objSw->gt("h", "gh"));
ok($objSw->lt("k", "kh"));
ok($objSw->lt("kz","kh"));
ok($objSw->gt("l", "kh"));
ok($objSw->lt("n", "ng'"));
ok($objSw->lt("nz","ng'"));
ok($objSw->lt("ng'","ny"));
ok($objSw->gt("o", "ny"));
ok($objSw->lt("s", "sh"));
ok($objSw->lt("sz","sh"));
ok($objSw->gt("t", "sh"));
ok($objSw->lt("t", "th"));
ok($objSw->lt("tz","th"));
ok($objSw->gt("u", "th"));

# 24

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

ok($objSw->eq("ch", "Ch"));
ok($objSw->eq("Ch", "CH"));
ok($objSw->eq("dh", "Dh"));
ok($objSw->eq("Dh", "DH"));
ok($objSw->eq("gh", "Gh"));
ok($objSw->eq("Gh", "GH"));
ok($objSw->eq("kh", "Kh"));
ok($objSw->eq("Kh", "KH"));
ok($objSw->eq("ng'","Ng'"));
ok($objSw->eq("Ng'","NG'"));
ok($objSw->eq("ny", "Ny"));
ok($objSw->eq("Ny", "NY"));
ok($objSw->eq("sh", "Sh"));
ok($objSw->eq("Sh", "SH"));
ok($objSw->eq("th", "Th"));
ok($objSw->eq("Th", "TH"));

# 40

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

ok($objSw->lt("ch", "Ch"));
ok($objSw->lt("Ch", "CH"));
ok($objSw->lt("dh", "Dh"));
ok($objSw->lt("Dh", "DH"));
ok($objSw->lt("gh", "Gh"));
ok($objSw->lt("Gh", "GH"));
ok($objSw->lt("kh", "Kh"));
ok($objSw->lt("Kh", "KH"));
ok($objSw->lt("ng'","Ng'"));
ok($objSw->lt("Ng'","NG'"));
ok($objSw->lt("ny", "Ny"));
ok($objSw->lt("Ny", "NY"));
ok($objSw->lt("sh", "Sh"));
ok($objSw->lt("Sh", "SH"));
ok($objSw->lt("th", "Th"));
ok($objSw->lt("Th", "TH"));

# 56

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

ok($objSw->gt("ch", "Ch"));
ok($objSw->gt("Ch", "CH"));
ok($objSw->gt("dh", "Dh"));
ok($objSw->gt("Dh", "DH"));
ok($objSw->gt("gh", "Gh"));
ok($objSw->gt("Gh", "GH"));
ok($objSw->gt("kh", "Kh"));
ok($objSw->gt("Kh", "KH"));
ok($objSw->gt("ng'","Ng'"));
ok($objSw->gt("Ng'","NG'"));
ok($objSw->gt("ny", "Ny"));
ok($objSw->gt("Ny", "NY"));
ok($objSw->gt("sh", "Sh"));
ok($objSw->gt("Sh", "SH"));
ok($objSw->gt("th", "Th"));
ok($objSw->gt("Th", "TH"));

# 72