|
Packit |
0bf95d |
#!/use/bin/perl
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
use strict;
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
BEGIN {
|
|
Packit |
0bf95d |
$| = 1;
|
|
Packit |
0bf95d |
$^W = 1;
|
|
Packit |
0bf95d |
}
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
use Test::More tests => 2;
|
|
Packit |
0bf95d |
use lib 't';
|
|
Packit |
0bf95d |
use common;
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
# RT #101092: Creation of non-standard streamed zip file
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
# Test that reading a zip file that contains a streamed member, then writing
|
|
Packit |
0bf95d |
# it without modification will set the local header fields for crc, compressed
|
|
Packit |
0bf95d |
# length & uncompressed length all to zero.
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
# streamed.zip can be created with the following one-liner:
|
|
Packit |
0bf95d |
#
|
|
Packit |
0bf95d |
# perl -MIO::Compress::Zip=zip -e 'zip \"abc" => "streamed.zip", Name => "fred", Stream => 1, Method =>8'
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
my $infile = "t/data/streamed.zip";
|
|
Packit |
0bf95d |
my $outfile = OUTPUTZIP;
|
|
Packit |
0bf95d |
passthrough($infile, $outfile);
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
my $before = readFile($infile);
|
|
Packit |
0bf95d |
my $after = readFile($outfile);
|
|
Packit |
0bf95d |
|
|
Packit |
0bf95d |
my ($status, $reason) = testZip($outfile);
|
|
Packit |
0bf95d |
is $status, 0
|
|
Packit |
0bf95d |
or warn("ziptest said: $reason\n");
|
|
Packit |
0bf95d |
ok $before eq $after;
|
|
Packit |
0bf95d |
|