4 @INC = ("../lib", "lib");
17 # use Test::NoWarnings, if available
20 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
22 plan tests => 10612 + $extra ;
25 use_ok('Compress::Zlib', 2) ;
27 use_ok('IO::Compress::Gzip', qw($GzipError)) ;
28 use_ok('IO::Uncompress::Gunzip', qw($GunzipError)) ;
30 use_ok('IO::Compress::Deflate', qw($DeflateError)) ;
31 use_ok('IO::Uncompress::Inflate', qw($InflateError)) ;
33 use_ok('IO::Compress::RawDeflate', qw($RawDeflateError)) ;
34 use_ok('IO::Uncompress::RawInflate', qw($RawInflateError)) ;
41 some more stuff on this line
45 foreach my $CompressClass ('IO::Compress::Gzip',
46 'IO::Compress::Deflate',
47 'IO::Compress::RawDeflate',
50 my $UncompressClass = getInverse($CompressClass);
53 print "#\n# Testing $UncompressClass\n#\n";
59 if ($CompressClass eq 'IO::Compress::Gzip') {
60 ok( my $x = new IO::Compress::Gzip \$compressed,
62 -Comment => "this is a comment",
63 -ExtraField => [ 'ab' => "extra"],
65 ok $x->write($hello) ;
69 #hexDump($compressed) ;
71 ok($gz = new IO::Uncompress::Gunzip \$cc,
74 or print "$GunzipError\n";
76 ok $gz->read($un) > 0 ;
81 ok( my $x = new $CompressClass(\$compressed));
82 ok $x->write($hello) ;
86 ok($gz = new $UncompressClass(\$cc,
88 or print "$GunzipError\n";
90 ok $gz->read($un) > 0 ;
95 for my $blocksize (1,2,13)
97 for my $i (0 .. length($compressed) - 1)
99 for my $useBuf (0 .. 1)
101 print "#\n# BlockSize $blocksize, Length $i, Buffer $useBuf\n#\n" ;
102 my $lex = new LexFile my $name ;
104 my $prime = substr($compressed, 0, $i);
105 my $rest = substr($compressed, $i);
113 writeFile($name, $rest);
116 #my $gz = new $UncompressClass $name,
117 my $gz = new $UncompressClass $start,
119 -BlockSize => $blocksize,
127 $status = $gz->read($un) while $status > 0 ;
129 or print "status $status\n" ;
131 or print "Error is '" . $gz->error() . "'\n";
133 or print "# got [$un]\n";