This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix ext/XS-APItest/t/multicall.t warning
[perl5.git] / lib / I18N / Collate.t
CommitLineData
532e0e8e
JH
1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require Config; import Config;
7 if (!$Config{d_setlocale} || $Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
8 print "1..0\n";
9 exit;
10 }
11}
12
13print "1..7\n";
14
15use I18N::Collate;
16
17print "ok 1\n";
18
19$a = I18N::Collate->new("foo");
20
21print "ok 2\n";
22
23{
24 use warnings;
25 local $SIG{__WARN__} = sub { $@ = $_[0] };
26 $b = I18N::Collate->new("foo");
27 print "not " unless $@ =~ /\bHAS BEEN DEPRECATED\b/;
28 print "ok 3\n";
29 $@ = '';
30}
31
32print "not " unless $a eq $b;
33print "ok 4\n";
34
35$b = I18N::Collate->new("bar");
36print "not " if $@ =~ /\bHAS BEEN DEPRECATED\b/;
37print "ok 5\n";
38
39print "not " if $a eq $b;
40print "ok 6\n";
41
42print "not " if $a lt $b == $a gt $b;
43print "ok 7\n";
44