IO::Compress::Base fails to trap read errors on the input filehandle.
Tested against 0.020 from blead. Failing test attached. Output:
1..1
read() on closed filehandle STDIN at
/home/dave/perlobj/installblead/lib/5.11.0/IO/Compress/Base.pm line 489.
Use of uninitialized value $status in numeric gt (>) at
/home/dave/perlobj/installblead/lib/5.11.0/IO/Compress/Base.pm line 489.
Use of uninitialized value $status in numeric lt (<) at
/home/dave/perlobj/installblead/lib/5.11.0/IO/Compress/Base.pm line 495.
not ok 1 - bzip2 failed on input read failure
# Failed test 'bzip2 failed on input read failure'
# at t.pl line 12.
# got: '1'
# expected: '0'
# Looks like you failed 1 test of 1.
Subject: | t.pl |
use strict;
use warnings;
use Test::More tests => 1;
use IO::Compress::Bzip2 qw/bzip2/;
close STDIN;
my $input = "0921783497324932749817234";
my $dest;
my $result = bzip2 \*STDIN => \$dest;
is $result, 0, "bzip2 failed on input read failure";