summaryrefslogtreecommitdiff
path: root/cpan/IO-Compress
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2013-10-18 18:20:31 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2013-10-18 18:21:25 +0100
commit84c82da487906645eec2128aa4d8f1cde743d405 (patch)
tree91309c55bd4086abcee7e37eadcd58b539c37125 /cpan/IO-Compress
parent8db6555210da586fd395dac83edcff64f4451570 (diff)
downloadperl-84c82da487906645eec2128aa4d8f1cde743d405.tar.gz
Remove further IGNORABLE-like files under cpan/
These are all examples, demos and oddly named READMEs.
Diffstat (limited to 'cpan/IO-Compress')
-rw-r--r--cpan/IO-Compress/examples/compress-zlib/filtdef29
-rw-r--r--cpan/IO-Compress/examples/compress-zlib/filtinf28
-rw-r--r--cpan/IO-Compress/examples/compress-zlib/gzcat27
-rw-r--r--cpan/IO-Compress/examples/compress-zlib/gzgrep27
-rw-r--r--cpan/IO-Compress/examples/compress-zlib/gzstream19
-rw-r--r--cpan/IO-Compress/examples/io/anycat17
-rw-r--r--cpan/IO-Compress/examples/io/bzip2/bzcat29
-rw-r--r--cpan/IO-Compress/examples/io/bzip2/bzgrep25
-rw-r--r--cpan/IO-Compress/examples/io/bzip2/bzstream9
-rw-r--r--cpan/IO-Compress/examples/io/gzip/gzappend24
-rw-r--r--cpan/IO-Compress/examples/io/gzip/gzcat29
-rw-r--r--cpan/IO-Compress/examples/io/gzip/gzgrep40
-rw-r--r--cpan/IO-Compress/examples/io/gzip/gzstream24
-rw-r--r--cpan/IO-Compress/t/010examples-bzip2.t134
-rw-r--r--cpan/IO-Compress/t/010examples-zlib.t135
-rw-r--r--cpan/IO-Compress/t/cz-05examples.t163
16 files changed, 0 insertions, 759 deletions
diff --git a/cpan/IO-Compress/examples/compress-zlib/filtdef b/cpan/IO-Compress/examples/compress-zlib/filtdef
deleted file mode 100644
index 57dfeb9068..0000000000
--- a/cpan/IO-Compress/examples/compress-zlib/filtdef
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-
-use Compress::Zlib ;
-
-binmode STDIN;
-binmode STDOUT;
-my $x = deflateInit()
- or die "Cannot create a deflation stream\n" ;
-
-my ($output, $status) ;
-while (<>)
-{
- ($output, $status) = $x->deflate($_) ;
-
- $status == Z_OK
- or die "deflation failed\n" ;
-
- print $output ;
-}
-
-($output, $status) = $x->flush() ;
-
-$status == Z_OK
- or die "deflation failed\n" ;
-
-print $output ;
diff --git a/cpan/IO-Compress/examples/compress-zlib/filtinf b/cpan/IO-Compress/examples/compress-zlib/filtinf
deleted file mode 100644
index 1df202b1d7..0000000000
--- a/cpan/IO-Compress/examples/compress-zlib/filtinf
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-
-use Compress::Zlib ;
-
-my $x = inflateInit()
- or die "Cannot create a inflation stream\n" ;
-
-my $input = '' ;
-binmode STDIN;
-binmode STDOUT;
-
-my ($output, $status) ;
-while (read(STDIN, $input, 4096))
-{
- ($output, $status) = $x->inflate(\$input) ;
-
- print $output
- if $status == Z_OK or $status == Z_STREAM_END ;
-
- last if $status != Z_OK ;
-}
-
-die "inflation failed\n"
- unless $status == Z_STREAM_END ;
-
diff --git a/cpan/IO-Compress/examples/compress-zlib/gzcat b/cpan/IO-Compress/examples/compress-zlib/gzcat
deleted file mode 100644
index 5241a5a11f..0000000000
--- a/cpan/IO-Compress/examples/compress-zlib/gzcat
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-
-use Compress::Zlib ;
-
-#die "Usage: gzcat file...\n"
-# unless @ARGV ;
-
-my $filename ;
-
-@ARGV = '-' unless @ARGV ;
-
-foreach my $filename (@ARGV) {
- my $buffer ;
-
- my $gz = gzopen($filename, "rb")
- or die "Cannot open $filename: $gzerrno\n" ;
-
- print $buffer while $gz->gzread($buffer) > 0 ;
-
- die "Error reading from $filename: $gzerrno" . ($gzerrno+0) . "\n"
- if $gzerrno != Z_STREAM_END ;
-
- $gz->gzclose() ;
-}
diff --git a/cpan/IO-Compress/examples/compress-zlib/gzgrep b/cpan/IO-Compress/examples/compress-zlib/gzgrep
deleted file mode 100644
index 324d3e615f..0000000000
--- a/cpan/IO-Compress/examples/compress-zlib/gzgrep
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-
-use Compress::Zlib ;
-
-die "Usage: gzgrep pattern file...\n"
- unless @ARGV >= 2;
-
-my $pattern = shift ;
-
-my $file ;
-
-foreach $file (@ARGV) {
- my $gz = gzopen($file, "rb")
- or die "Cannot open $file: $gzerrno\n" ;
-
- while ($gz->gzreadline($_) > 0) {
- print if /$pattern/ ;
- }
-
- die "Error reading from $file: $gzerrno\n"
- if $gzerrno != Z_STREAM_END ;
-
- $gz->gzclose() ;
-}
diff --git a/cpan/IO-Compress/examples/compress-zlib/gzstream b/cpan/IO-Compress/examples/compress-zlib/gzstream
deleted file mode 100644
index faacb0a0dd..0000000000
--- a/cpan/IO-Compress/examples/compress-zlib/gzstream
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-
-use Compress::Zlib ;
-
-binmode STDOUT; # gzopen only sets it on the fd
-
-#my $gz = gzopen(\*STDOUT, "wb")
-my $gz = gzopen('-', "wb")
- or die "Cannot open stdout: $gzerrno\n" ;
-
-while (<>) {
- $gz->gzwrite($_)
- or die "error writing: $gzerrno\n" ;
-}
-
-$gz->gzclose ;
diff --git a/cpan/IO-Compress/examples/io/anycat b/cpan/IO-Compress/examples/io/anycat
deleted file mode 100644
index b7f7001b5e..0000000000
--- a/cpan/IO-Compress/examples/io/anycat
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-
-use IO::Uncompress::AnyUncompress qw( anyuncompress $AnyUncompressError );
-
-@ARGV = '-' unless @ARGV ;
-
-foreach my $file (@ARGV) {
-
- anyuncompress $file => '-',
- Transparent => 1,
- Strict => 0,
- or die "Cannot uncompress '$file': $AnyUncompressError\n" ;
-
-}
diff --git a/cpan/IO-Compress/examples/io/bzip2/bzcat b/cpan/IO-Compress/examples/io/bzip2/bzcat
deleted file mode 100644
index 81123200c5..0000000000
--- a/cpan/IO-Compress/examples/io/bzip2/bzcat
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/local/bin/perl
-
-use IO::Uncompress::Bunzip2 qw( $Bunzip2Error );
-use strict ;
-use warnings ;
-
-#die "Usage: gzcat file...\n"
-# unless @ARGV ;
-
-my $file ;
-my $buffer ;
-my $s;
-
-@ARGV = '-' unless @ARGV ;
-
-foreach $file (@ARGV) {
-
- my $gz = new IO::Uncompress::Bunzip2 $file
- or die "Cannot open $file: $Bunzip2Error\n" ;
-
- print $buffer
- while ($s = $gz->read($buffer)) > 0 ;
-
- die "Error reading from $file: $Bunzip2Error\n"
- if $s < 0 ;
-
- $gz->close() ;
-}
-
diff --git a/cpan/IO-Compress/examples/io/bzip2/bzgrep b/cpan/IO-Compress/examples/io/bzip2/bzgrep
deleted file mode 100644
index ceb4e8412b..0000000000
--- a/cpan/IO-Compress/examples/io/bzip2/bzgrep
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/perl
-
-use strict ;
-use warnings ;
-use IO::Uncompress::Bunzip2 qw($Bunzip2Error);
-
-die "Usage: gzgrep pattern [file...]\n"
- unless @ARGV >= 1;
-
-my $pattern = shift ;
-my $file ;
-
-@ARGV = '-' unless @ARGV ;
-
-foreach $file (@ARGV) {
- my $gz = new IO::Uncompress::Bunzip2 $file
- or die "Cannot uncompress $file: $Bunzip2Error\n" ;
-
- while (<$gz>) {
- print if /$pattern/ ;
- }
-
- die "Error reading from $file: $Bunzip2Error\n"
- if $Bunzip2Error ;
-}
diff --git a/cpan/IO-Compress/examples/io/bzip2/bzstream b/cpan/IO-Compress/examples/io/bzip2/bzstream
deleted file mode 100644
index 3e88d68258..0000000000
--- a/cpan/IO-Compress/examples/io/bzip2/bzstream
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-use IO::Compress::Bzip2 qw(:all);
-
-bzip2 '-' => '-'
- or die "bzstream: $Bzip2Error\n" ;
-
diff --git a/cpan/IO-Compress/examples/io/gzip/gzappend b/cpan/IO-Compress/examples/io/gzip/gzappend
deleted file mode 100644
index a4a60a9aad..0000000000
--- a/cpan/IO-Compress/examples/io/gzip/gzappend
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/local/bin/perl
-
-use IO::Compress::Gzip qw( $GzipError );
-use strict ;
-use warnings ;
-
-die "Usage: gzappend gz-file file...\n"
- unless @ARGV ;
-
-
-my $output = shift @ARGV ;
-
-@ARGV = '-' unless @ARGV ;
-
-my $gz = new IO::Compress::Gzip $output, Merge => 1
- or die "Cannot open $output: $GzipError\n" ;
-
-$gz->write( [@ARGV] )
- or die "Cannot open $output: $GzipError\n" ;
-
-$gz->close;
-
-
-
diff --git a/cpan/IO-Compress/examples/io/gzip/gzcat b/cpan/IO-Compress/examples/io/gzip/gzcat
deleted file mode 100644
index 5572bae959..0000000000
--- a/cpan/IO-Compress/examples/io/gzip/gzcat
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/local/bin/perl
-
-use IO::Uncompress::Gunzip qw( $GunzipError );
-use strict ;
-use warnings ;
-
-#die "Usage: gzcat file...\n"
-# unless @ARGV ;
-
-my $file ;
-my $buffer ;
-my $s;
-
-@ARGV = '-' unless @ARGV ;
-
-foreach $file (@ARGV) {
-
- my $gz = new IO::Uncompress::Gunzip $file
- or die "Cannot open $file: $GunzipError\n" ;
-
- print $buffer
- while ($s = $gz->read($buffer)) > 0 ;
-
- die "Error reading from $file: $GunzipError\n"
- if $s < 0 ;
-
- $gz->close() ;
-}
-
diff --git a/cpan/IO-Compress/examples/io/gzip/gzgrep b/cpan/IO-Compress/examples/io/gzip/gzgrep
deleted file mode 100644
index 33820ba064..0000000000
--- a/cpan/IO-Compress/examples/io/gzip/gzgrep
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/perl
-
-use strict ;
-use warnings ;
-use IO::Uncompress::Gunzip qw($GunzipError);
-
-die "Usage: gzgrep pattern [file...]\n"
- unless @ARGV >= 1;
-
-my $pattern = shift ;
-my $file ;
-
-@ARGV = '-' unless @ARGV ;
-
-foreach $file (@ARGV) {
- my $gz = new IO::Uncompress::Gunzip $file
- or die "Cannot uncompress $file: $GunzipError\n" ;
-
- while (<$gz>) {
- print if /$pattern/ ;
- }
-
- die "Error reading from $file: $GunzipError\n"
- if $GunzipError ;
-}
-
-__END__
-foreach $file (@ARGV) {
- my $gz = gzopen($file, "rb")
- or die "Cannot open $file: $gzerrno\n" ;
-
- while ($gz->gzreadline($_) > 0) {
- print if /$pattern/ ;
- }
-
- die "Error reading from $file: $gzerrno\n"
- if $gzerrno != Z_STREAM_END ;
-
- $gz->gzclose() ;
-}
diff --git a/cpan/IO-Compress/examples/io/gzip/gzstream b/cpan/IO-Compress/examples/io/gzip/gzstream
deleted file mode 100644
index 9d03bc5749..0000000000
--- a/cpan/IO-Compress/examples/io/gzip/gzstream
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/local/bin/perl
-
-use strict ;
-use warnings ;
-use IO::Compress::Gzip qw(gzip $GzipError);
-
-gzip '-' => '-', Minimal => 1
- or die "gzstream: $GzipError\n" ;
-
-#exit 0;
-
-__END__
-
-#my $gz = new IO::Compress::Gzip *STDOUT
-my $gz = new IO::Compress::Gzip '-'
- or die "gzstream: Cannot open stdout as gzip stream: $GzipError\n" ;
-
-while (<>) {
- $gz->write($_)
- or die "gzstream: Error writing gzip output stream: $GzipError\n" ;
-}
-
-$gz->close
- or die "gzstream: Error closing gzip output stream: $GzipError\n" ;
diff --git a/cpan/IO-Compress/t/010examples-bzip2.t b/cpan/IO-Compress/t/010examples-bzip2.t
deleted file mode 100644
index 2248535f7d..0000000000
--- a/cpan/IO-Compress/t/010examples-bzip2.t
+++ /dev/null
@@ -1,134 +0,0 @@
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = ("../lib", "lib/compress");
- }
-}
-
-use lib qw(t t/compress);
-
-use strict;
-use warnings;
-use bytes;
-
-use Test::More ;
-use CompTestUtils;
-use IO::Compress::Bzip2 'bzip2' ;
-
-BEGIN
-{
- plan(skip_all => "Examples needs Perl 5.005 or better - you have Perl $]" )
- if $] < 5.005 ;
-
- # use Test::NoWarnings, if available
- my $extra = 0 ;
- $extra = 1
- if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
-
- plan tests => 19 + $extra ;
-}
-
-
-my $Inc = join " ", map qq["-I$_"] => @INC;
-$Inc = '"-MExtUtils::testlib"'
- if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
-
-my $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
-$Perl = qq["$Perl"] if $^O eq 'MSWin32' ;
-
-$Perl = "$Perl $Inc -w" ;
-#$Perl .= " -Mblib " ;
-my $examples = $ENV{PERL_CORE} ? "../ext/IO-Compress/examples/io/bzip2"
- : "./examples/io/bzip2";
-
-my $hello1 = <<EOM ;
-hello
-this is
-a test
-message
-x ttttt
-xuuuuuu
-the end
-EOM
-
-my @hello1 = grep(s/$/\n/, split(/\n/, $hello1)) ;
-
-my $hello2 = <<EOM;
-
-Howdy
-this is the
-second
-file
-x ppppp
-xuuuuuu
-really the end
-EOM
-
-my @hello2 = grep(s/$/\n/, split(/\n/, $hello2)) ;
-
-my ($file1, $file2, $stderr) ;
-my $lex = new LexFile $file1, $file2, $stderr ;
-
-bzip2 \$hello1 => $file1 ;
-bzip2 \$hello2 => $file2 ;
-
-sub check
-{
- my $command = shift ;
- my $expected = shift ;
-
- my $lex = new LexFile my $stderr ;
-
- my $cmd = "$command 2>$stderr";
- my $stdout = `$cmd` ;
-
- my $aok = 1 ;
-
- $aok &= is $?, 0, " exit status is 0" ;
-
- $aok &= is readFile($stderr), '', " no stderr" ;
-
- $aok &= is $stdout, $expected, " expected content is ok"
- if defined $expected ;
-
- if (! $aok) {
- diag "Command line: $cmd";
- my ($file, $line) = (caller)[1,2];
- diag "Test called from $file, line $line";
- }
-
- 1 while unlink $stderr;
-}
-
-# bzcat
-# #####
-
-title "bzcat - command line" ;
-check "$Perl ${examples}/bzcat $file1 $file2", $hello1 . $hello2;
-
-title "bzcat - stdin" ;
-check "$Perl ${examples}/bzcat <$file1 ", $hello1;
-
-
-# bzgrep
-# ######
-
-title "bzgrep";
-check "$Perl ${examples}/bzgrep the $file1 $file2",
- join('', grep(/the/, @hello1, @hello2));
-
-for ($file1, $file2, $stderr) { 1 while unlink $_ } ;
-
-
-
-# bzstream
-# ########
-
-{
- title "bzstream" ;
- writeFile($file1, $hello1) ;
- check "$Perl ${examples}/bzstream <$file1 >$file2";
-
- title "bzcat" ;
- check "$Perl ${examples}/bzcat $file2", $hello1 ;
-}
diff --git a/cpan/IO-Compress/t/010examples-zlib.t b/cpan/IO-Compress/t/010examples-zlib.t
deleted file mode 100644
index 70e7141088..0000000000
--- a/cpan/IO-Compress/t/010examples-zlib.t
+++ /dev/null
@@ -1,135 +0,0 @@
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = ("../lib", "lib/compress");
- }
-}
-
-use lib qw(t t/compress);
-
-use strict;
-use warnings;
-use bytes;
-
-use Test::More ;
-use CompTestUtils;
-use IO::Compress::Gzip 'gzip' ;
-
-BEGIN
-{
- plan(skip_all => "Examples needs Perl 5.005 or better - you have Perl $]" )
- if $] < 5.005 ;
-
- # use Test::NoWarnings, if available
- my $extra = 0 ;
- $extra = 1
- if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
-
- plan tests => 19 + $extra ;
-}
-
-
-my $Inc = join " ", map qq["-I$_"] => @INC;
-$Inc = '"-MExtUtils::testlib"'
- if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
-
-my $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
-$Perl = qq["$Perl"] if $^O eq 'MSWin32' ;
-
-$Perl = "$Perl $Inc -w" ;
-#$Perl .= " -Mblib " ;
-my $examples = $ENV{PERL_CORE} ? "../ext/IO-Compress/examples/io/gzip"
- : "./examples/io/gzip";
-
-my $hello1 = <<EOM ;
-hello
-this is
-a test
-message
-x ttttt
-xuuuuuu
-the end
-EOM
-
-my @hello1 = grep(s/$/\n/, split(/\n/, $hello1)) ;
-
-my $hello2 = <<EOM;
-
-Howdy
-this is the
-second
-file
-x ppppp
-xuuuuuu
-really the end
-EOM
-
-my @hello2 = grep(s/$/\n/, split(/\n/, $hello2)) ;
-
-my ($file1, $file2, $stderr) ;
-my $lex = new LexFile $file1, $file2, $stderr ;
-
-gzip \$hello1 => $file1 ;
-gzip \$hello2 => $file2 ;
-
-sub check
-{
- my $command = shift ;
- my $expected = shift ;
-
- my $lex = new LexFile my $stderr ;
-
-
- my $cmd = "$command 2>$stderr";
- my $stdout = `$cmd` ;
-
- my $aok = 1 ;
-
- $aok &= is $?, 0, " exit status is 0" ;
-
- $aok &= is readFile($stderr), '', " no stderr" ;
-
- $aok &= is $stdout, $expected, " expected content is ok"
- if defined $expected ;
-
- if (! $aok) {
- diag "Command line: $cmd";
- my ($file, $line) = (caller)[1,2];
- diag "Test called from $file, line $line";
- }
-
- 1 while unlink $stderr;
-}
-
-# gzcat
-# #####
-
-title "gzcat - command line" ;
-check "$Perl ${examples}/gzcat $file1 $file2", $hello1 . $hello2;
-
-title "gzcat - stdin" ;
-check "$Perl ${examples}/gzcat <$file1 ", $hello1;
-
-
-# gzgrep
-# ######
-
-title "gzgrep";
-check "$Perl ${examples}/gzgrep the $file1 $file2",
- join('', grep(/the/, @hello1, @hello2));
-
-for ($file1, $file2, $stderr) { 1 while unlink $_ } ;
-
-
-
-# gzstream
-# ########
-
-{
- title "gzstream" ;
- writeFile($file1, $hello1) ;
- check "$Perl ${examples}/gzstream <$file1 >$file2";
-
- title "gzcat" ;
- check "$Perl ${examples}/gzcat $file2", $hello1 ;
-}
diff --git a/cpan/IO-Compress/t/cz-05examples.t b/cpan/IO-Compress/t/cz-05examples.t
deleted file mode 100644
index 5a8fb33e20..0000000000
--- a/cpan/IO-Compress/t/cz-05examples.t
+++ /dev/null
@@ -1,163 +0,0 @@
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = ("../lib", "lib/compress");
- }
-}
-
-use lib qw(t t/compress);
-
-use strict;
-use warnings;
-use bytes;
-
-use Test::More ;
-use CompTestUtils;
-use Compress::Zlib;
-
-BEGIN
-{
- plan(skip_all => "Examples needs Perl 5.005 or better - you have Perl $]" )
- if $] < 5.005 ;
-
- # use Test::NoWarnings, if available
- my $extra = 0 ;
- $extra = 1
- if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
-
- plan tests => 26 + $extra ;
-}
-
-
-my $Inc = join " ", map qq["-I$_"] => @INC;
-$Inc = '"-MExtUtils::testlib"'
- if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
-
-my $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
-$Perl = qq["$Perl"] if $^O eq 'MSWin32' ;
-
-$Perl = "$Perl $Inc -w" ;
-my $examples = $ENV{PERL_CORE} ? "../ext/IO-Compress/examples/compress-zlib"
- : "./examples/compress-zlib";
-
-my $hello1 = <<EOM ;
-hello
-this is
-a test
-message
-x ttttt
-xuuuuuu
-the end
-EOM
-
-my @hello1 = grep(s/$/\n/, split(/\n/, $hello1)) ;
-
-my $hello2 = <<EOM;
-
-Howdy
-this is the
-second
-file
-x ppppp
-xuuuuuu
-really the end
-EOM
-
-my @hello2 = grep(s/$/\n/, split(/\n/, $hello2)) ;
-
-my $file1 = "hello1.gz" ;
-my $file2 = "hello2.gz" ;
-my $stderr = "err.out" ;
-
-for ($file1, $file2, $stderr) { 1 while unlink $_ } ;
-
-
-my $gz = gzopen($file1, "wb");
-$gz->gzwrite($hello1);
-$gz->gzclose();
-
-$gz = gzopen($file2, "wb");
-$gz->gzwrite($hello2);
-$gz->gzclose();
-
-sub check
-{
- my $command = shift ;
- my $expected = shift ;
-
- my $stderr = 'err.out';
- 1 while unlink $stderr;
-
- my $cmd = "$command 2>$stderr";
- my $stdout = `$cmd` ;
-
- my $aok = 1 ;
-
- $aok &= is $?, 0, " exit status is 0" ;
-
- $aok &= is readFile($stderr), '', " no stderr" ;
-
- $aok &= is $stdout, $expected, " expected content is ok"
- if defined $expected ;
-
- if (! $aok) {
- diag "Command line: $cmd";
- my ($file, $line) = (caller)[1,2];
- diag "Test called from $file, line $line";
- }
-
- 1 while unlink $stderr;
-}
-
-# gzcat
-# #####
-
-title "gzcat - command line" ;
-check "$Perl ${examples}/gzcat $file1 $file2", $hello1 . $hello2;
-
-title "gzcat - stdin" ;
-check "$Perl ${examples}/gzcat <$file1 ", $hello1;
-
-
-# gzgrep
-# ######
-
-title "gzgrep";
-check "$Perl ${examples}/gzgrep the $file1 $file2",
- join('', grep(/the/, @hello1, @hello2));
-
-for ($file1, $file2, $stderr) { 1 while unlink $_ } ;
-
-
-
-# filtdef/filtinf
-# ##############
-
-
-writeFile($file1, $hello1) ;
-writeFile($file2, $hello2) ;
-
-title "filtdef" ;
-# there's no way to set binmode on backticks in Win32 so we won't use $a later
-check "$Perl ${examples}/filtdef $file1 $file2" ;
-
-title "filtdef | filtinf";
-check "$Perl ${examples}/filtdef $file1 $file2 | $Perl ${examples}/filtinf",
- $hello1 . $hello2;
-# gzstream
-# ########
-
-{
- title "gzstream" ;
- writeFile($file1, $hello1) ;
- check "$Perl ${examples}/gzstream <$file1 >$file2";
-
- title "gzcat" ;
- check "$Perl ${examples}/gzcat $file2", $hello1 ;
-}
-
-END
-{
- for ($file1, $file2, $stderr) { 1 while unlink $_ } ;
-}
-