diff options
Diffstat (limited to 'cpan/Unicode-Collate/t/cjk_ko.t')
-rw-r--r-- | cpan/Unicode-Collate/t/cjk_ko.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpan/Unicode-Collate/t/cjk_ko.t b/cpan/Unicode-Collate/t/cjk_ko.t index 69f4c7cc4c..8be7106594 100644 --- a/cpan/Unicode-Collate/t/cjk_ko.t +++ b/cpan/Unicode-Collate/t/cjk_ko.t @@ -12,7 +12,7 @@ BEGIN { } use Test; -BEGIN { plan tests => 51 }; +BEGIN { plan tests => 52 }; use strict; use warnings; @@ -29,6 +29,14 @@ my $collator = Unicode::Collate->new( overrideCJK => \&Unicode::Collate::CJK::Korean::weightKorean ); +sub hex_sort { + my @source = map pack('U', hex $_), split ' ', shift; + my @sorted = $collator->sort(@source); + return join " ", map sprintf("%04X", unpack 'U', $_), @sorted; +} + +# 1 + $collator->change(level => 1); ok($collator->eq("\x{AC00}", "\x{4F3D}")); @@ -98,3 +106,8 @@ ok($collator->lt("\x{20003}", "\x{20004}")); ok($collator->lt("\x{20004}", "\x{20005}")); # 51 + +ok(hex_sort('4E00 4E8C 4E09 56DB 4E94 516D 4E03 516B 4E5D 5341'), + '4E5D 516D 56DB 4E09 5341 4E94 4E8C 4E00 4E03 516B'); + +# 52 |