1 2BEGIN { 3 unless ("A" eq pack('U', 0x41)) { 4 print "1..0 # Unicode::Collate " . 5 "cannot stringify a Unicode code point\n"; 6 exit 0; 7 } 8 if ($ENV{PERL_CORE}) { 9 chdir('t') if -d 't'; 10 @INC = $^O eq 'MacOS' ? qw(::lib) : qw(../lib); 11 } 12} 13 14use strict; 15use warnings; 16BEGIN { $| = 1; print "1..12\n"; } 17my $count = 0; 18sub ok ($;$) { 19 my $p = my $r = shift; 20 if (@_) { 21 my $x = shift; 22 $p = !defined $x ? !defined $r : !defined $r ? 0 : $r eq $x; 23 } 24 print $p ? "ok" : "not ok", ' ', ++$count, "\n"; 25} 26 27use Unicode::Collate::Locale; 28 29ok(1); 30 31######################### 32 33my $objBn = Unicode::Collate::Locale-> 34 new(locale => 'BN', normalization => undef); 35 36ok($objBn->getlocale, 'bn'); 37 38$objBn->change(level => 1); 39 40for my $h (0, 1) { 41 no warnings 'utf8'; 42 my $t = $h ? pack('U', 0xFFFF) : ""; 43 $objBn->change(highestFFFF => 1) if $h; 44 45 ok($objBn->lt("\x{993}$t", "\x{994}")); 46 ok($objBn->lt("\x{994}$t", "\x{982}")); 47 ok($objBn->lt("\x{982}$t", "\x{983}")); 48 ok($objBn->lt("\x{983}$t", "\x{981}")); 49 ok($objBn->lt("\x{981}$t", "\x{995}")); 50} 51