4 @INC = ("../lib", "lib/compress");
8 use lib qw(t t/compress);
19 # Check external gzip is available
21 for my $dir (split ":", $ENV{PATH})
27 plan(skip_all => "Cannot find $name")
31 # use Test::NoWarnings, if available
34 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
36 plan tests => 7 + $extra ;
38 use_ok('IO::Compress::Gzip', ':all') ;
39 use_ok('IO::Uncompress::Gunzip', ':all') ;
49 my $comp = "$GZIP -dc" ;
51 open F, "$comp $file |";
68 my $options = shift || '';
71 my $gzip = "$GZIP -c $options >$file" ;
82 title "Test interop with $GZIP" ;
86 my $lex = new LexFile $file, $file1;
87 my $content = "hello world\n" ;
90 is writeWithGzip($file, $content), 0, "writeWithGzip ok";
92 gunzip $file => \$got ;
96 gzip \$content => $file1;
98 is readWithGzip($file1, $got), 0, "readWithGzip returns 0";
99 is $got, $content, "got content";