diff options
author | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-11-22 19:32:55 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-11-22 19:32:55 +0000 |
commit | dc7edc5c5d81282c7d6425fbd4bbf2b51a30a481 (patch) | |
tree | 8c3026797e6a9ce936cedccdd8bd182c1945b057 /cpan/IO-Compress/t | |
parent | 7e7003692ef1ef562fa6ff1177c64ec749cfe5da (diff) | |
download | perl-dc7edc5c5d81282c7d6425fbd4bbf2b51a30a481.tar.gz |
Update IO-Compress to CPAN version 2.043
[DELTA]
2.043 20 November 2011
* IO::Compress::Base
- Fixed issue that with handling of Zip files with two (or more)
entries that were STORED. Symptom is the first is uncompressed
ok, but the next will terminate early if the size of the file is
greater than BlockSize.
Regression test added to t/006zip.t
[RT# 72548]
Diffstat (limited to 'cpan/IO-Compress/t')
-rw-r--r-- | cpan/IO-Compress/t/000prereq.t | 2 | ||||
-rw-r--r-- | cpan/IO-Compress/t/006zip.t | 32 |
2 files changed, 31 insertions, 3 deletions
diff --git a/cpan/IO-Compress/t/000prereq.t b/cpan/IO-Compress/t/000prereq.t index 13417aa66c..b5ff655a87 100644 --- a/cpan/IO-Compress/t/000prereq.t +++ b/cpan/IO-Compress/t/000prereq.t @@ -25,7 +25,7 @@ BEGIN if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - my $VERSION = '2.042'; + my $VERSION = '2.043'; my @NAMES = qw( Compress::Raw::Bzip2 Compress::Raw::Zlib diff --git a/cpan/IO-Compress/t/006zip.t b/cpan/IO-Compress/t/006zip.t index 2dfa52cabb..b2868025f5 100644 --- a/cpan/IO-Compress/t/006zip.t +++ b/cpan/IO-Compress/t/006zip.t @@ -19,7 +19,7 @@ BEGIN { $extra = 1 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - plan tests => 77 + $extra ; + plan tests => 85 + $extra ; use_ok('IO::Compress::Zip', qw(:all)) ; use_ok('IO::Uncompress::Unzip', qw(unzip $UnzipError)) ; @@ -38,7 +38,7 @@ sub getContent { my $filename = shift; - my $u = new IO::Uncompress::Unzip $filename, Append => 1 + my $u = new IO::Uncompress::Unzip $filename, Append => 1, @_ or die "Cannot open $filename: $UnzipError"; isa_ok $u, "IO::Uncompress::Unzip"; @@ -247,6 +247,34 @@ SKIP: is $got[2], $content[2], "Got 3nd entry"; } +{ + title "RT #72548"; + + my $lex = new LexFile my $file1; + + my $blockSize = 1024 * 16; + + my @content = ( + 'hello', + "x" x ($blockSize + 1) + ); + + my $zip = new IO::Compress::Zip $file1, + Name => "one", Method => ZIP_CM_STORE, Stream => 0; + isa_ok $zip, "IO::Compress::Zip"; + + is $zip->write($content[0]), length($content[0]), "write"; + + $zip->newStream(Name=> "two", Method => ZIP_CM_STORE); + is $zip->write($content[1]), length($content[1]), "write"; + + ok $zip->close(), "closed"; + + my @got = getContent($file1, BlockSize => $blockSize); + + is $got[0], $content[0], "Got 1st entry"; + is $got[1], $content[1], "Got 2nd entry"; +} SKIP: for my $method (ZIP_CM_DEFLATE, ZIP_CM_STORE, ZIP_CM_BZIP2) |