12 # use Test::NoWarnings, if available
15 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
17 plan tests => 48 + $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" x 100 ;
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);
58 my $unc = new $AnyConstruct $input, Transparent => $trans,
62 ok $unc, " Created $AnyClass object"
63 or print "# $$AnyError\n";
65 1 while $unc->read($uncomp) > 0 ;
66 #ok $unc->read($uncomp) > 0
67 # or print "# $$AnyError\n";
69 is $unc->read($y, 1), 0, " at eof" ;
70 ok $unc->eof(), " at eof" ;
71 #ok $unc->type eq $Type;
73 is $uncomp, $string, " expected output" ;
77 my $unc = new $AnyConstruct $input, Transparent => $trans,
81 ok $unc, " Created $AnyClass object"
82 or print "# $$AnyError\n";
84 1 while $unc->read($uncomp, 100) > 0 ;
85 #ok $unc->read($uncomp) > 0
86 # or print "# $$AnyError\n";
88 is $unc->read($y, 1), 0, " at eof" ;
89 ok $unc->eof(), " at eof" ;
90 #ok $unc->type eq $Type;
92 is $uncomp, $string, " expected output" ;