12 # use Test::NoWarnings, if available
15 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
17 plan tests => 36 + $extra ;
22 my $CompressClass = identify();
23 my $AnyClass = getClass();
24 my $UncompressClass = getInverse($CompressClass);
25 my $Error = getErrorRef($CompressClass);
26 my $UnError = getErrorRef($UncompressClass);
28 my $AnyConstruct = "IO::Uncompress::${AnyClass}" ;
30 my $AnyError = \${ "IO::Uncompress::${AnyClass}::${AnyClass}Error" };
32 for my $trans ( 0, 1 )
36 title "$AnyClass(Transparent => $trans, File=>$file) with $CompressClass" ;
37 my $string = "some text" x 100 ;
40 my $x = new $CompressClass(\$buffer) ;
41 ok $x, " create $CompressClass object" ;
42 ok $x->write($string), " write to object" ;
43 ok $x->close, " close ok" ;
45 my $lex = new LexFile my $output;
49 writeFile($output, $buffer);
57 my $unc = new $AnyConstruct $input, Transparent => $trans
60 ok $unc, " Created $AnyClass object"
61 or print "# $$AnyError\n";
63 1 while $unc->read($uncomp) > 0 ;
64 #ok $unc->read($uncomp) > 0
65 # or print "# $$AnyError\n";
67 is $unc->read($y, 1), 0, " at eof" ;
68 ok $unc->eof(), " at eof" ;
69 #ok $unc->type eq $Type;
71 is $uncomp, $string, " expected output" ;
75 my $unc = new $AnyConstruct $input, Transparent => $trans,
78 ok $unc, " Created $AnyClass object"
79 or print "# $$AnyError\n";
81 1 while $unc->read($uncomp, 10) > 0 ;
83 is $unc->read($y, 1), 0, " at eof" ;
84 ok $unc->eof(), " at eof" ;
85 #ok $unc->type eq $Type;
87 is $uncomp, $string, " expected output" ;