X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FEncode%2Ft%2FCJKT.t;h=5421f2334abb84070f41e4c158d74c7213910340;hb=ab3374e4b7f0adca0bcf6e7b71aaacbfd7df7b07;hp=412d01e24d7bc92a4ea35e7fdbb8fcb82edb3d28;hpb=6e3dd797c11bfbcd0b6afff17d355b401f2f8429;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Encode/t/CJKT.t b/ext/Encode/t/CJKT.t index 412d01e..5421f23 100644 --- a/ext/Encode/t/CJKT.t +++ b/ext/Encode/t/CJKT.t @@ -20,7 +20,8 @@ BEGIN { $| = 1; } use strict; -use Test::More tests => 73; +use Test::More tests => 42; +#use Test::More tests => 73; #use Test::More qw(no_plan); use Encode; use File::Basename; @@ -44,7 +45,7 @@ my %Charset = my $dir = dirname(__FILE__); my $seq = 1; -for my $charset (sort keys %Charset) { +for my $charset (sort keys %Charset){ my ($src, $uni, $dst, $txt); my $transcoder = find_encoding($Charset{$charset}[0]) or die; @@ -70,7 +71,7 @@ for my $charset (sort keys %Charset) { if (PerlIO::Layer->find('perlio')){ binmode($dst, ":utf8"); print $dst $uni; - } else { # ugh! + }else{ # ugh! binmode($dst); my $raw = $uni; Encode::_utf8_off($raw); print $dst $raw; @@ -85,31 +86,27 @@ for my $charset (sort keys %Charset) { if (PerlIO::Layer->find('perlio')){ binmode($src, ":utf8"); $uni = join('', <$src>); - } else { # ugh! + }else{ # ugh! binmode($src); $uni = join('', <$src>); Encode::_utf8_on($uni); } close $src; + my $unisave = $uni; eval{ $txt = $transcoder->encode($uni,1) }; $@ and print $@; ok(defined($txt), "encode $charset"); $seq++; is(length($uni), 0, "encode $charset completely"); $seq++; + $uni = $unisave; open $dst,">$dst_enc" or die "$dst_utf : $!"; binmode($dst); - binmode($dst, ":bytes"); # in case LC_ALL is UTF8ish print $dst $txt; close($dst); is(compare_text($src_enc, $dst_enc), 0 => "$dst_enc eq $src_enc") or ($DEBUG and rename $dst_enc, "$dst_enc.$seq"); $seq++; - for my $canon (@{$Charset{$charset}}){ - is($uni, decode($canon, encode($canon, $uni)), - "RT/$charset/$canon"); - $seq++; - } unlink($dst_utf, $dst_enc); }