summaryrefslogtreecommitdiff
path: root/cpan/IO-Compress/t/006zip.t
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/IO-Compress/t/006zip.t')
-rw-r--r--cpan/IO-Compress/t/006zip.t32
1 files changed, 30 insertions, 2 deletions
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)