18 plan(skip_all => "Destroy not supported in Perl $]")
19 if $] == 5.008 || ( $] >= 5.005 && $] < 5.006) ;
21 # use Test::NoWarnings, if available
24 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
26 plan tests => 23 + $extra ;
28 use_ok('IO::Compress::Gzip', qw($GzipError)) ;
29 use_ok('IO::Compress::Deflate', qw($DeflateError)) ;
30 use_ok('IO::Uncompress::AnyInflate', qw($AnyInflateError)) ;
31 use_ok('IO::Compress::RawDeflate', qw($RawDeflateError)) ;
36 foreach my $CompressClass ('IO::Compress::Gzip',
37 'IO::Compress::Deflate',
38 'IO::Compress::RawDeflate')
40 title "Testing $CompressClass";
44 # Check that the class destructor will call close
46 my $name = "test.gz" ;
48 my $lex = new LexFile $name ;
57 ok my $x = new $CompressClass $name, -AutoClose => 1 ;
59 ok $x->write($hello) ;
62 is anyUncompress($name), $hello ;
66 # Tied filehandle destructor
69 my $name = "test.gz" ;
70 my $lex = new LexFile $name ;
77 my $fh = new IO::File "> $name" ;
80 ok my $x = new $CompressClass $fh, -AutoClose => 1 ;
85 ok anyUncompress($name) eq $hello ;