summaryrefslogtreecommitdiff
path: root/t/17_101092.t
diff options
context:
space:
mode:
Diffstat (limited to 't/17_101092.t')
-rw-r--r--t/17_101092.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/17_101092.t b/t/17_101092.t
new file mode 100644
index 0000000..2b2983b
--- /dev/null
+++ b/t/17_101092.t
@@ -0,0 +1,34 @@
+#!/use/bin/perl
+
+use strict;
+
+BEGIN {
+ $| = 1;
+ $^W = 1;
+}
+
+use Test::More tests => 2;
+use t::common;
+
+# RT #101092: Creation of non-standard streamed zip file
+
+# Test that reading a zip file that contains a streamed member, then writing
+# it without modification will set the local header fields for crc, compressed
+# length & uncompressed length all to zero.
+
+# streamed.zip can be created with the following one-liner:
+#
+# perl -MIO::Compress::Zip=zip -e 'zip \"abc" => "streamed.zip", Name => "fred", Stream => 1, Method =>8'
+
+my $infile = "t/data/streamed.zip";
+my $outfile = OUTPUTZIP;
+passthrough($infile, $outfile);
+
+my $before = readFile($infile);
+my $after = readFile($outfile);
+
+my ($status, $reason) = testZip($outfile);
+is $status, 0
+ or warn("ziptest said: $reason\n");
+ok $before eq $after;
+