12 plan(skip_all => "Destroy not supported in Perl $]")
13 if $] == 5.008 || ( $] >= 5.005 && $] < 5.006) ;
15 # use Test::NoWarnings, if available
18 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
20 plan tests => 23 + $extra ;
22 use_ok('IO::Compress::Gzip', qw($GzipError)) ;
23 use_ok('IO::Compress::Deflate', qw($DeflateError)) ;
24 use_ok('IO::Uncompress::AnyInflate', qw($AnyInflateError)) ;
25 use_ok('IO::Compress::RawDeflate', qw($RawDeflateError)) ;
30 foreach my $CompressClass ('IO::Compress::Gzip',
31 'IO::Compress::Deflate',
32 'IO::Compress::RawDeflate')
34 title "Testing $CompressClass";
38 # Check that the class destructor will call close
40 my $name = "test.gz" ;
42 my $lex = new LexFile $name ;
51 ok my $x = new $CompressClass $name, -AutoClose => 1 ;
53 ok $x->write($hello) ;
56 is anyUncompress($name), $hello ;
60 # Tied filehandle destructor
63 my $name = "test.gz" ;
64 my $lex = new LexFile $name ;
71 my $fh = new IO::File "> $name" ;
74 ok my $x = new $CompressClass $fh, -AutoClose => 1 ;
79 ok anyUncompress($name) eq $hello ;