summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-05 14:51:50 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-05 14:51:50 +0000
commit51ef4e1196e74554150c2d1993b5a0e37f6709c9 (patch)
treeb3c7f984d3bbe182b93da70fc63c2e7f0e7d55e1 /t
parent26c1551e60cd5bd52d80b74e7d16ea4a8437d156 (diff)
downloadperl-51ef4e1196e74554150c2d1993b5a0e37f6709c9.tar.gz
Encode implementation "completion"
Implement and document define_encoding() Implement and document encoding aliases including define_alias() Make Encode::XS use define_encoding() rather than back-door. Move run-time *.enc to separate Encode::Tcl module. Make 'compile' honour <codeset_name> Change canonical names of to iso-8859-* and US-ascii. p4raw-id: //depot/perlio@9032
Diffstat (limited to 't')
-rw-r--r--t/lib/encode.t15
1 files changed, 12 insertions, 3 deletions
diff --git a/t/lib/encode.t b/t/lib/encode.t
index da4d1b851e..af1f34bb4f 100644
--- a/t/lib/encode.t
+++ b/t/lib/encode.t
@@ -8,15 +8,15 @@ BEGIN {
}
}
use Test;
-use Encode qw(from_to encode decode encode_utf8 decode_utf8);
+use Encode qw(from_to encode decode encode_utf8 decode_utf8 find_encoding);
use charnames qw(greek);
-my @encodings = grep(/iso8859/,Encode::encodings());
+my @encodings = grep(/iso-?8859/,Encode::encodings());
my $n = 2;
my @character_set = ('0'..'9', 'A'..'Z', 'a'..'z');
my @source = qw(ascii iso8859-1 cp1250);
my @destiny = qw(cp1047 cp37 posix-bc);
my @ebcdic_sets = qw(cp1047 cp37 posix-bc);
-plan test => 33+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256;
+plan test => 38+$n*@encodings + 2*@source*@destiny*@character_set + 2*@ebcdic_sets*256;
my $str = join('',map(chr($_),0x20..0x7E));
my $cpy = $str;
ok(length($str),from_to($cpy,'iso8859-1','Unicode'),"Length Wrong");
@@ -91,6 +91,15 @@ foreach my $enc_eb (@ebcdic_sets)
}
}
+my $mime = find_encoding('iso-8859-2');
+ok(defined($mime),1,"Cannot find MIME-ish'iso-8859-2'");
+my $x11 = find_encoding('iso8859-2');
+ok(defined($x11),1,"Cannot find X11-ish 'iso8859-2'");
+ok($mime,$x11,"iso8598-2 and iso-8859-2 not same");
+my $spc = find_encoding('iso 8859-2');
+ok(defined($spc),1,"Cannot find 'iso 8859-2'");
+ok($spc,$mime,"iso 8859-2 and iso-8859-2 not same");
+
for my $i (256,128,129,256)
{
my $c = chr($i);