diff options
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) |