From 716af0bc850525c7a6f2e2d5d635f5e8200deeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 19 Mar 2022 09:35:03 +0800 Subject: [PATCH] Simplified the code to write to the compression I/O in the test suite helper. --- t/_helper.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/_helper.pm b/t/_helper.pm index 3abd91c..778f891 100644 --- a/t/_helper.pm +++ b/t/_helper.pm @@ -355,7 +355,7 @@ sub write_file($$) { open $FH, ">$file" or die this_file . ": $file: $!"; $gz = IO::Compress::Gzip->new($FH) 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"; $gz->close or die this_file . ": $file: $IO::Compress::Gzip::GzipError"; return; @@ -379,7 +379,7 @@ sub write_file($$) { open $FH, ">$file" or die this_file . ": $file: $!"; $bz = IO::Compress::Bzip2->new($FH) 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"; $bz->close or die this_file . ": $file: $IO::Compress::Bzip2::Bzip2Error"; return; @@ -403,7 +403,7 @@ sub write_file($$) { open $FH, ">$file" or die this_file . ": $file: $!"; $xz = IO::Compress::Xz->new($FH) 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"; $xz->close or die this_file . ": $file: $IO::Compress::Xz::XzError"; return;