diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-09-30 13:25:48 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-09-30 13:30:14 +0100 |
commit | a3e5f045e1bd1e071601ce7597065b00d78a1e0d (patch) | |
tree | 6bcbd560e0f4d9788f1022d3c0f33a7815981d39 /cpan/Unicode-Collate/t/version.t | |
parent | c62c1f54deb45ddd2a6c8ef06d63c4a6943494a8 (diff) | |
download | perl-a3e5f045e1bd1e071601ce7597065b00d78a1e0d.tar.gz |
Move Unicode::Collate from ext/ to dist/
Diffstat (limited to 'cpan/Unicode-Collate/t/version.t')
-rw-r--r-- | cpan/Unicode-Collate/t/version.t | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/cpan/Unicode-Collate/t/version.t b/cpan/Unicode-Collate/t/version.t new file mode 100644 index 0000000000..17adf539ca --- /dev/null +++ b/cpan/Unicode-Collate/t/version.t @@ -0,0 +1,58 @@ + +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 => 17 }; + +use strict; +use warnings; +use Unicode::Collate; + +ok(1); + +######################### + +# Fix me when UCA and/or keys.txt is upgraded. +my $UCA_Version = "14"; +my $Base_Unicode_Version = "4.1.0"; +my $Key_Version = "3.1.1"; + +ok(Unicode::Collate::UCA_Version, $UCA_Version); +ok(Unicode::Collate->UCA_Version, $UCA_Version); +ok(Unicode::Collate::Base_Unicode_Version, $Base_Unicode_Version); +ok(Unicode::Collate->Base_Unicode_Version, $Base_Unicode_Version); + +my $Collator = Unicode::Collate->new( + table => 'keys.txt', + normalization => undef, +); + +ok($Collator->UCA_Version, $UCA_Version); +ok($Collator->UCA_Version(), $UCA_Version); +ok($Collator->Base_Unicode_Version, $Base_Unicode_Version); +ok($Collator->Base_Unicode_Version(), $Base_Unicode_Version); +ok($Collator->version, $Key_Version); +ok($Collator->version(), $Key_Version); + +my $UndefTable = Unicode::Collate->new( + table => undef, + normalization => undef, +); + +ok($UndefTable->UCA_Version, $UCA_Version); +ok($UndefTable->UCA_Version(), $UCA_Version); +ok($UndefTable->Base_Unicode_Version, $Base_Unicode_Version); +ok($UndefTable->Base_Unicode_Version(), $Base_Unicode_Version); +ok($UndefTable->version, "unknown"); +ok($UndefTable->version(), "unknown"); + |