$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 36 + $extra ;
+ plan tests => 48 + $extra ;
}
for my $file ( 0, 1 )
{
title "$AnyClass(Transparent => $trans, File=>$file) with $CompressClass" ;
- my $string = "some text";
+ my $string = "some text" x 100 ;
my $buffer ;
my $x = new $CompressClass(\$buffer) ;
$input = \$buffer;
}
- my $unc = new $AnyConstruct $input, Transparent => $trans ;
+ {
+ my $unc = new $AnyConstruct $input, Transparent => $trans,
+ RawInflate => 1,
+ Append => 1 ;
- ok $unc, " Created $AnyClass object"
- or print "# $$AnyError\n";
- my $uncomp ;
- ok $unc->read($uncomp) > 0
- or print "# $$AnyError\n";
- my $y;
- is $unc->read($y, 1), 0, " at eof" ;
- ok $unc->eof(), " at eof" ;
- #ok $unc->type eq $Type;
+ ok $unc, " Created $AnyClass object"
+ or print "# $$AnyError\n";
+ my $uncomp ;
+ 1 while $unc->read($uncomp) > 0 ;
+ #ok $unc->read($uncomp) > 0
+ # or print "# $$AnyError\n";
+ my $y;
+ is $unc->read($y, 1), 0, " at eof" ;
+ ok $unc->eof(), " at eof" ;
+ #ok $unc->type eq $Type;
- is $uncomp, $string, " expected output" ;
+ is $uncomp, $string, " expected output" ;
+ }
+
+ {
+ my $unc = new $AnyConstruct $input, Transparent => $trans,
+ RawInflate => 1,
+ Append => 1 ;
+
+ ok $unc, " Created $AnyClass object"
+ or print "# $$AnyError\n";
+ my $uncomp ;
+ 1 while $unc->read($uncomp, 100) > 0 ;
+ #ok $unc->read($uncomp) > 0
+ # or print "# $$AnyError\n";
+ my $y;
+ is $unc->read($y, 1), 0, " at eof" ;
+ ok $unc->eof(), " at eof" ;
+ #ok $unc->type eq $Type;
+
+ is $uncomp, $string, " expected output" ;
+ }
}
}
}
my $TopTypeInverse = getInverse($bit);
my $FuncInverse = getTopFuncRef($TopTypeInverse);
+ my @opts = ();
+ @opts = (RawInflate => 1)
+ if $CompressClass eq 'IO::Compress::RawInflate';
+
for my $append ( 1, 0 )
{
my $already = '';
my $incumbent = "incumbent data" ;
+ my @opts = ();
+ @opts = (RawInflate => 1)
+ if $bit eq 'IO::Uncompress::AnyUncompress';
+
for my $append (0, 1)
{
my $expected = $buffer ;
my $output ;
$output = $incumbent if $append ;
- ok &$Func(\$comp, \$output, Append => $append), ' Uncompressed ok' ;
+ ok &$Func(\$comp, \$output, Append => $append, @opts), ' Uncompressed ok' ;
is $keep_comp, $comp, " Input buffer not changed" ;
is $output, $expected, " Uncompressed matches original";
my @output = ('first');
#$output = $incumbent if $append ;
- ok &$Func(\$comp, \@output, Append => $append), ' Uncompressed ok' ;
+ ok &$Func(\$comp, \@output, Append => $append, @opts), ' Uncompressed ok' ;
is $keep_comp, $comp, " Input buffer not changed" ;
is $output[0], 'first', " Uncompressed matches original";
else
{ ok ! -e $out_file, " Output file does not exist" }
- ok &$Func(\$comp, $out_file, Append => $append), ' Uncompressed ok' ;
+ ok &$Func(\$comp, $out_file, Append => $append, @opts), ' Uncompressed ok' ;
ok -e $out_file, " Created output file";
my $content = readFile($out_file) ;
}
isa_ok $of, 'IO::File', ' $of' ;
- ok &$Func(\$comp, $of, Append => $append, AutoClose => 1), ' Uncompressed ok' ;
+ ok &$Func(\$comp, $of, Append => $append, AutoClose => 1, @opts), ' Uncompressed ok' ;
ok -e $out_file, " Created output file";
my $content = readFile($out_file) ;
writeFile($in_file, $comp);
- ok &$Func($in_file, $out_file, Append => $append), ' Uncompressed ok' ;
+ ok &$Func($in_file, $out_file, Append => $append, @opts), ' Uncompressed ok' ;
ok -e $out_file, " Created output file";
my $content = readFile($out_file) ;
writeFile($in_file, $comp);
- ok &$Func($in_file, $out, Append => $append, AutoClose => 1), ' Uncompressed ok' ;
+ ok &$Func($in_file, $out, Append => $append, AutoClose => 1, @opts), ' Uncompressed ok' ;
ok -e $out_file, " Created output file";
my $content = readFile($out_file) ;
my $output ;
$output = $incumbent if $append ;
- ok &$Func($in_file, \$output, Append => $append), ' Uncompressed ok' ;
+ ok &$Func($in_file, \$output, Append => $append, @opts), ' Uncompressed ok' ;
is $keep_comp, $comp, " Input buffer not changed" ;
is $output, $expected, " Uncompressed matches original";
writeFile($in_file, $comp);
my $in = new IO::File "<$in_file" ;
- ok &$Func($in, $out_file, Append => $append), ' Uncompressed ok' ;
+ ok &$Func($in, $out_file, Append => $append, @opts), ' Uncompressed ok' ;
ok -e $out_file, " Created output file";
my $content = readFile($out_file) ;
writeFile($in_file, $comp);
my $in = new IO::File "<$in_file" ;
- ok &$Func($in, $out, Append => $append, AutoClose => 1), ' Uncompressed ok' ;
+ ok &$Func($in, $out, Append => $append, AutoClose => 1, @opts), ' Uncompressed ok' ;
ok -e $out_file, " Created output file";
my $content = readFile($out_file) ;
my $output ;
$output = $incumbent if $append ;
- ok &$Func($in, \$output, Append => $append), ' Uncompressed ok' ;
+ ok &$Func($in, \$output, Append => $append, @opts), ' Uncompressed ok' ;
is $keep_comp, $comp, " Input buffer not changed" ;
is $output, $expected, " Uncompressed matches original";
my $output ;
$output = $incumbent if $append ;
- ok &$Func('-', \$output, Append => $append), ' Uncompressed ok'
+ ok &$Func('-', \$output, Append => $append, @opts), ' Uncompressed ok'
or diag $$Error ;
open(STDIN, "<&SAVEIN");
writeFile($in_file, $comp . $appended . $comp . $appended) ;
my $in = new IO::File "<$in_file" ;
- ok &$Func($in, \$out, Transparent => 0, InputLength => length $comp), ' Uncompressed ok' ;
+ ok &$Func($in, \$out, Transparent => 0, InputLength => length $comp, @opts), ' Uncompressed ok' ;
is $out, $expected, " Uncompressed matches original";
is $buff, $appended, " Appended data ok";
$out = '';
- ok &$Func($in, \$out, Transparent => 0, InputLength => length $comp), ' Uncompressed ok' ;
+ ok &$Func($in, \$out, Transparent => 0, InputLength => length $comp, @opts), ' Uncompressed ok' ;
is $out, $expected, " Uncompressed matches original";
my $output ;
- ok &$Func($stdin, \$output, Transparent => 0, InputLength => length $comp), ' Uncompressed ok'
+ ok &$Func($stdin, \$output, Transparent => 0, InputLength => length $comp, @opts), ' Uncompressed ok'
or diag $$Error ;
my $buff ;
my $comp = compressBuffer(getTopFuncName($UncompressClass), $buffer) ;
my $keep_comp = $comp;
+ my @opts = ();
+ @opts = (RawInflate => 1)
+ if $bit eq 'IO::Uncompress::AnyUncompress';
+
my $incumbent = "incumbent data" ;
my $lex = new LexFile(my $file1, my $file2) ;
title "$TopType - From ArrayRef to Buffer" ;
my $output ;
- ok &$Func(\@input, \$output, AutoClose => 0), ' UnCompressed ok' ;
+ ok &$Func(\@input, \$output, AutoClose => 0, @opts), ' UnCompressed ok' ;
is $output, join('', @expected)
}
my $lex = new LexFile my $output;
$of->open("<$file1") ;
- ok &$Func(\@input, $output, AutoClose => 0), ' UnCompressed ok' ;
+ ok &$Func(\@input, $output, AutoClose => 0, @opts), ' UnCompressed ok' ;
is readFile($output), join('', @expected)
}
my $fh = new IO::File ">$output" ;
$of->open("<$file1") ;
- ok &$Func(\@input, $fh, AutoClose => 0), ' UnCompressed ok' ;
+ ok &$Func(\@input, $fh, AutoClose => 0, @opts), ' UnCompressed ok' ;
$fh->close;
is readFile($output), join('', @expected)
my @output = (\'first') ;
$of->open("<$file1") ;
- ok &$Func(\@input, \@output, AutoClose => 0), ' UnCompressed ok' ;
+ ok &$Func(\@input, \@output, AutoClose => 0, @opts), ' UnCompressed ok' ;
is_deeply \@input, \@keep, " Input array not changed" ;
is_deeply [map { defined $$_ ? $$_ : "" } @output],
mkdir $tmpDir1, 0777;
mkdir $tmpDir2, 0777;
+ my @opts = ();
+ @opts = (RawInflate => 1)
+ if $bit eq 'IO::Uncompress::AnyUncompress';
+
ok -d $tmpDir1, " Temp Directory $tmpDir1 exists";
#ok ! -d $tmpDir2, " Temp Directory $tmpDir2 does not exist";
{
title "$TopType - From FileGlob to FileGlob" ;
- ok &$Func("<$tmpDir1/a*.tmp>" => "<$tmpDir2/a#1.tmp>"), ' UnCompressed ok'
+ ok &$Func("<$tmpDir1/a*.tmp>" => "<$tmpDir2/a#1.tmp>", @opts), ' UnCompressed ok'
or diag $$Error ;
my @copy = @expected;
title "$TopType - From FileGlob to Arrayref" ;
my @output = (\'first');
- ok &$Func("<$tmpDir1/a*.tmp>" => \@output), ' UnCompressed ok'
+ ok &$Func("<$tmpDir1/a*.tmp>" => \@output, @opts), ' UnCompressed ok'
or diag $$Error ;
my @copy = ('first', @expected);
title "$TopType - From FileGlob to Buffer" ;
my $output ;
- ok &$Func("<$tmpDir1/a*.tmp>" => \$output), ' UnCompressed ok'
+ ok &$Func("<$tmpDir1/a*.tmp>" => \$output, @opts), ' UnCompressed ok'
or diag $$Error ;
is $output, join('', @expected), " got expected uncompressed data";
my $lex = new LexFile my $output ;
ok ! -e $output, " $output does not exist" ;
- ok &$Func("<$tmpDir1/a*.tmp>" => $output), ' UnCompressed ok'
+ ok &$Func("<$tmpDir1/a*.tmp>" => $output, @opts), ' UnCompressed ok'
or diag $$Error ;
ok -e $output, " $output does exist" ;
my $output = 'abc' ;
my $lex = new LexFile $output ;
my $fh = new IO::File ">$output" ;
- ok &$Func("<$tmpDir1/a*.tmp>" => $fh, AutoClose => 1), ' UnCompressed ok'
+ ok &$Func("<$tmpDir1/a*.tmp>" => $fh, AutoClose => 1, @opts), ' UnCompressed ok'
or diag $$Error ;
ok -e $output, " $output does exist" ;