12 # use Test::NoWarnings, if available
15 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
17 plan tests => 36 + $extra ;
23 my $CompressClass = identify();
24 my $AnyClass = getClass();
25 my $UncompressClass = getInverse($CompressClass);
26 my $Error = getErrorRef($CompressClass);
27 my $UnError = getErrorRef($UncompressClass);
29 my $AnyConstruct = "IO::Uncompress::${AnyClass}" ;
31 my $AnyError = \${ "IO::Uncompress::${AnyClass}::${AnyClass}Error" };
33 for my $trans ( 0, 1 )
37 title "$AnyClass(Transparent => $trans, File=>$file) with $CompressClass" ;
38 my $string = "some text";
41 my $x = new $CompressClass(\$buffer) ;
42 ok $x, " create $CompressClass object" ;
43 ok $x->write($string), " write to object" ;
44 ok $x->close, " close ok" ;
46 my $lex = new LexFile my $output;
50 writeFile($output, $buffer);
57 my $unc = new $AnyConstruct $input, Transparent => $trans ;
59 ok $unc, " Created $AnyClass object"
60 or print "# $$AnyError\n";
62 ok $unc->read($uncomp) > 0
63 or print "# $$AnyError\n";
65 is $unc->read($y, 1), 0, " at eof" ;
66 ok $unc->eof(), " at eof" ;
67 #ok $unc->type eq $Type;
69 is $uncomp, $string, " expected output" ;