diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-10 23:24:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-06-10 23:24:42 +0000 |
commit | cb3fb9b75cd1198d350357a3c5e4acd60bf2ecbf (patch) | |
tree | fbedf74a5aad4c7d7bb0833776bbe9ece458a6e0 /ext | |
parent | 1ddff52a1281532cbd0c62e75300cd5f2fb50094 (diff) | |
download | perl-cb3fb9b75cd1198d350357a3c5e4acd60bf2ecbf.tar.gz |
Now that binmode(FH) does implicit ":bytes" revisit
the failing tests. The worrisome one is the Digest::MD5
test-- how will it fare in CRLF lands now?
p4raw-id: //depot/perl@17175
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Digest/MD5/t/files.t | 3 | ||||
-rw-r--r-- | ext/Encode/t/CJKT.t | 9 | ||||
-rw-r--r-- | ext/Encode/t/guess.t | 8 | ||||
-rw-r--r-- | ext/PerlIO/t/fallback.t | 6 | ||||
-rw-r--r-- | ext/Storable/t/malice.t | 2 |
5 files changed, 8 insertions, 20 deletions
diff --git a/ext/Digest/MD5/t/files.t b/ext/Digest/MD5/t/files.t index 34ef9e0dea..b49149ccb9 100644 --- a/ext/Digest/MD5/t/files.t +++ b/ext/Digest/MD5/t/files.t @@ -175,7 +175,6 @@ sub digest_file #print "$file $method\n"; open(FILE, $file) or die "Can't open $file: $!"; - eval { binmode(FILE, ":bytes") }; # Perl 5.8.0+ only my $digest = Digest::MD5->new->addfile(*FILE)->$method(); close(FILE); @@ -187,7 +186,7 @@ sub cat_file my($file) = @_; local $/; # slurp open(FILE, $file) or die "Can't open $file: $!"; - eval { binmode(FILE, ":bytes") }; # Perl 5.8.0+ only + binmode(FILE); my $tmp = <FILE>; close(FILE); $tmp; diff --git a/ext/Encode/t/CJKT.t b/ext/Encode/t/CJKT.t index 411511ec4a..0c9bb7b65a 100644 --- a/ext/Encode/t/CJKT.t +++ b/ext/Encode/t/CJKT.t @@ -44,7 +44,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 +70,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,7 +85,7 @@ 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); @@ -99,9 +99,6 @@ for my $charset (sort keys %Charset) { open $dst,">$dst_enc" or die "$dst_utf : $!"; binmode($dst); - if (PerlIO::Layer->find('perlio')) { - 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") diff --git a/ext/Encode/t/guess.t b/ext/Encode/t/guess.t index 667537a6e8..bd403d35e6 100644 --- a/ext/Encode/t/guess.t +++ b/ext/Encode/t/guess.t @@ -48,9 +48,7 @@ my $jisx0208 = File::Spec->catfile(dirname(__FILE__), 'jisx0208.utf'); my $jisx0212 = File::Spec->catfile(dirname(__FILE__), 'jisx0212.utf'); open my $fh, $jisx0208 or die "$jisx0208: $!"; -if (PerlIO::Layer->find('perlio')) { - binmode($fh, ":bytes"); # in case LC_ALL is UTF8ish -} +binmode($fh); $utf8off = join('' => <$fh>); close $fh; $utf8on = decode('utf8', $utf8off); @@ -80,9 +78,7 @@ Encode::Guess->set_suspects(keys %CJKT); for my $name (keys %CJKT){ open my $fh, $CJKT{$name} or die "$CJKT{$name}: $!"; - if (PerlIO::Layer->find('perlio')) { - binmode($fh, ":bytes"); # in case LC_ALL is UTF8ish - } + binmode($fh); $utf8off = join('' => <$fh>); close $fh; diff --git a/ext/PerlIO/t/fallback.t b/ext/PerlIO/t/fallback.t index 1cefa0d52a..049972e201 100644 --- a/ext/PerlIO/t/fallback.t +++ b/ext/PerlIO/t/fallback.t @@ -48,7 +48,8 @@ close($fh); { no utf8; - open($fh,">:bytes",$file) || die "File cannot be re-opened"; + open($fh,">$file") || die "File cannot be re-opened"; + binmode($fh); print $fh "\xA30.02\n"; close($fh); } @@ -70,6 +71,3 @@ close($fh); END { 1 while unlink($file); } - - - diff --git a/ext/Storable/t/malice.t b/ext/Storable/t/malice.t index 31cbbd13de..405fd3d5e1 100644 --- a/ext/Storable/t/malice.t +++ b/ext/Storable/t/malice.t @@ -95,7 +95,6 @@ sub store_and_retrieve { unlink $file or die "Can't unlink '$file': $!"; open FH, ">$file" or die "Can't open '$file': $!"; binmode FH; - eval { binmode(FH, ":bytes") }; # Perl 5.8.0+ only print FH $data or die "Can't print to '$file': $!"; close FH or die "Can't close '$file': $!"; @@ -259,7 +258,6 @@ sub slurp { local (*FH, $/); open FH, "<$file" or die "Can't open '$file': $!"; binmode FH; - eval { binmode(FH, ":bytes") }; # Perl 5.8.0+ only my $contents = <FH>; die "Can't read $file: $!" unless defined $contents; return $contents; |