⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rearrang.t

📁 source of perl for linux application,
💻 T
字号:
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 => 23 };use strict;use warnings;use Unicode::Collate;ok(1);#########################my $Collator = Unicode::Collate->new(  table => 'keys.txt',  normalization => undef,  UCA_Version => 9,);# rearrange : 0x0E40..0x0E44, 0x0EC0..0x0EC4 (default)##### 2..9my %old_rearrange = $Collator->change(rearrange => undef);ok($Collator->gt("\x{0E41}A", "\x{0E40}B"));ok($Collator->gt("A\x{0E41}A", "A\x{0E40}B"));$Collator->change(rearrange => [ 0x61 ]); # U+0061, 'a': This is a Unicode value, never a native value.ok($Collator->gt("ab", "AB")); # as 'ba' > 'AB'$Collator->change(%old_rearrange);ok($Collator->lt("ab", "AB"));ok($Collator->lt("\x{0E40}", "\x{0E41}"));ok($Collator->lt("\x{0E40}A", "\x{0E41}B"));ok($Collator->lt("\x{0E41}A", "\x{0E40}B"));ok($Collator->lt("A\x{0E41}A", "A\x{0E40}B"));##### 10..13my $all_undef_8 = Unicode::Collate->new(  table => undef,  normalization => undef,  overrideCJK => undef,  overrideHangul => undef,  UCA_Version => 8,);ok($all_undef_8->lt("\x{0E40}", "\x{0E41}"));ok($all_undef_8->lt("\x{0E40}A", "\x{0E41}B"));ok($all_undef_8->lt("\x{0E41}A", "\x{0E40}B"));ok($all_undef_8->lt("A\x{0E41}A", "A\x{0E40}B"));##### 14..18my $no_rearrange = Unicode::Collate->new(  table => undef,  normalization => undef,  rearrange => [],  UCA_Version => 9,);ok($no_rearrange->lt("A", "B"));ok($no_rearrange->lt("\x{0E40}", "\x{0E41}"));ok($no_rearrange->lt("\x{0E40}A", "\x{0E41}B"));ok($no_rearrange->gt("\x{0E41}A", "\x{0E40}B"));ok($no_rearrange->gt("A\x{0E41}A", "A\x{0E40}B"));##### 19..23my $undef_rearrange = Unicode::Collate->new(  table => undef,  normalization => undef,  rearrange => undef,  UCA_Version => 9,);ok($undef_rearrange->lt("A", "B"));ok($undef_rearrange->lt("\x{0E40}", "\x{0E41}"));ok($undef_rearrange->lt("\x{0E40}A", "\x{0E41}B"));ok($undef_rearrange->gt("\x{0E41}A", "\x{0E40}B"));ok($undef_rearrange->gt("A\x{0E41}A", "A\x{0E40}B"));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -