4 @INC = ("../lib", "lib");
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 $lex = new LexFile my $name ;
55 ok my $x = new $CompressClass $name, -AutoClose => 1 ;
57 ok $x->write($hello) ;
60 is anyUncompress($name), $hello ;
64 # Tied filehandle destructor
67 my $lex = new LexFile my $name ;
74 my $fh = new IO::File "> $name" ;
77 ok my $x = new $CompressClass $fh, -AutoClose => 1 ;
82 ok anyUncompress($name) eq $hello ;