Simplified the code to write to the compression I/O in the test suite helper.

This commit is contained in:
依瑪貓 2022-03-19 09:35:03 +08:00
parent 2f11fc5f0f
commit 716af0bc85

View File

@ -355,7 +355,7 @@ sub write_file($$) {
open $FH, ">$file" or die this_file . ": $file: $!"; open $FH, ">$file" or die this_file . ": $file: $!";
$gz = IO::Compress::Gzip->new($FH) $gz = IO::Compress::Gzip->new($FH)
or die this_file . ": $file: $IO::Compress::Gzip::GzipError"; or die this_file . ": $file: $IO::Compress::Gzip::GzipError";
($gz->write($content, length $content) == length $content) ($gz->write($content) == length $content)
or die this_file . ": $file: $IO::Compress::Gzip::GzipError"; or die this_file . ": $file: $IO::Compress::Gzip::GzipError";
$gz->close or die this_file . ": $file: $IO::Compress::Gzip::GzipError"; $gz->close or die this_file . ": $file: $IO::Compress::Gzip::GzipError";
return; return;
@ -379,7 +379,7 @@ sub write_file($$) {
open $FH, ">$file" or die this_file . ": $file: $!"; open $FH, ">$file" or die this_file . ": $file: $!";
$bz = IO::Compress::Bzip2->new($FH) $bz = IO::Compress::Bzip2->new($FH)
or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error"; or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error";
($bz->write($content, length $content) == length $content) ($bz->write($content) == length $content)
or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error"; or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error";
$bz->close or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error"; $bz->close or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error";
return; return;
@ -403,7 +403,7 @@ sub write_file($$) {
open $FH, ">$file" or die this_file . ": $file: $!"; open $FH, ">$file" or die this_file . ": $file: $!";
$xz = IO::Compress::Xz->new($FH) $xz = IO::Compress::Xz->new($FH)
or die this_file . ": $file: $IO::Compress::Xz::XzError"; or die this_file . ": $file: $IO::Compress::Xz::XzError";
($xz->write($content, length $content) == length $content) ($xz->write($content) == length $content)
or die this_file . ": $file: $IO::Compress::Xz::XzError"; or die this_file . ": $file: $IO::Compress::Xz::XzError";
$xz->close or die this_file . ": $file: $IO::Compress::Xz::XzError"; $xz->close or die this_file . ": $file: $IO::Compress::Xz::XzError";
return; return;