summaryrefslogtreecommitdiff
path: root/t/lib/i18n-collate.t
blob: bf3ba20b6aaa24bcfc9ffcc9f77d1ed33073150b (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
#!./perl

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
    require Config; import Config;
    if (!$Config{d_setlocale} || $Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
	print "1..0\n";
	exit;
    }
}

print "1..7\n";

use I18N::Collate;

print "ok 1\n";

$a = I18N::Collate->new("foo");

print "ok 2\n";

{
    use warnings;
    local $SIG{__WARN__} = sub { $@ = $_[0] };
    $b = I18N::Collate->new("foo");
    print "not " unless $@ =~ /\bHAS BEEN DEPRECATED\b/;
    print "ok 3\n";
    $@ = '';
}

print "not " unless $a eq $b;
print "ok 4\n";

$b = I18N::Collate->new("bar");
print "not " if $@ =~ /\bHAS BEEN DEPRECATED\b/;
print "ok 5\n";

print "not " if $a eq $b;
print "ok 6\n";

print "not " if $a lt $b == $a gt $b;
print "ok 7\n";