summaryrefslogtreecommitdiff
path: root/cpan/IO-Compress/t/compress/oneshot.pl
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-05-18 20:23:39 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2011-06-09 12:17:09 +0100
commitc23ee15d0c5621f673a78a873392c506a2b470f8 (patch)
tree195ef8040c019d78ea7633423a753075342868fc /cpan/IO-Compress/t/compress/oneshot.pl
parent882c7064de216e4687c6d4721e523ecd1f05c78a (diff)
downloadperl-c23ee15d0c5621f673a78a873392c506a2b470f8.tar.gz
Updated IO-Compress to CPAN version 2.035
[DELTA] 2.035 6 May 2011 * RT #67931: Test failure on Windows 2.034 2 May 2011 * Compress::Zlib - Silence pod warnings. [RT# 64876] - Removed duplicate words in pod. * IO::Compress::Base - RT #56942: Testsuite fails when being run in parallel - Reduce symbol import - patch from J. Nick Koston - If the output buffer parameter passed to read has a value of undef, and Append mode was specified when the file was opened, and eof is reached, then the buffer paramer was left as undef. This is different from when Append isn't specified - the buffer parameter is set to an empty string. - There area couple of issues with reading a file that contains an empty file that is compressed. Create with -- touch /tmp/empty; gzip /tmp/empty. Issue 1 - eof is not true immediately. Have to read from the file to trigger eof. Issue 2 - readline incorrectly returns an empty string the first time it is called, and (correctly) undef thereafter. [RT #67554]
Diffstat (limited to 'cpan/IO-Compress/t/compress/oneshot.pl')
-rw-r--r--cpan/IO-Compress/t/compress/oneshot.pl45
1 files changed, 19 insertions, 26 deletions
diff --git a/cpan/IO-Compress/t/compress/oneshot.pl b/cpan/IO-Compress/t/compress/oneshot.pl
index 78d17275b7..102f221da5 100644
--- a/cpan/IO-Compress/t/compress/oneshot.pl
+++ b/cpan/IO-Compress/t/compress/oneshot.pl
@@ -79,18 +79,18 @@ sub run
}
{
- my $dir = "tmpdir";
+ my $dir ;
my $lex = new LexDir $dir ;
- mkdir $dir, 0777 ;
+ my $d = quotemeta $dir;
- $a = $Func->($dir, \$x) ;
+ $a = $Func->("$dir", \$x) ;
is $a, undef, " $TopType returned undef";
- like $$Error, "/input file '$dir' is a directory/",
+ like $$Error, "/input file '$d' is a directory/",
' Input filename is a directory';
- $a = $Func->(\$x, $dir) ;
+ $a = $Func->(\$x, "$dir") ;
is $a, undef, " $TopType returned undef";
- like $$Error, "/output file '$dir' is a directory/",
+ like $$Error, "/output file '$d' is a directory/",
' Output filename is a directory';
}
@@ -890,21 +890,19 @@ sub run
for my $files ( [qw(a1)], [qw(a1 a2 a3)] )
{
- my $tmpDir1 = 'tmpdir1';
- my $tmpDir2 = 'tmpdir2';
+ my $tmpDir1 ;
+ my $tmpDir2 ;
my $lex = new LexDir($tmpDir1, $tmpDir2) ;
-
- mkdir $tmpDir1, 0777;
- mkdir $tmpDir2, 0777;
+ my $d1 = quotemeta $tmpDir1 ;
+ my $d2 = quotemeta $tmpDir2 ;
ok -d $tmpDir1, " Temp Directory $tmpDir1 exists";
- #ok ! -d $tmpDir2, " Temp Directory $tmpDir2 does not exist";
my @files = map { "$tmpDir1/$_.tmp" } @$files ;
foreach (@files) { writeFile($_, "abc $_") }
my @expected = map { "abc $_" } @files ;
- my @outFiles = map { s/$tmpDir1/$tmpDir2/; $_ } @files ;
+ my @outFiles = map { s/$d1/$tmpDir2/; $_ } @files ;
{
title "$TopType - From FileGlob to FileGlob files [@$files]" ;
@@ -961,8 +959,7 @@ sub run
{
title "$TopType - From FileGlob to Filename files [@$files], MS $ms" ;
- my $filename = "abcde";
- my $lex = new LexFile($filename) ;
+ my $lex = new LexFile(my $filename) ;
ok &$Func("<$tmpDir1/a*.tmp>" => $filename,
MultiStream => $ms), ' Compressed ok'
@@ -980,8 +977,7 @@ sub run
{
title "$TopType - From FileGlob to Filehandle files [@$files], MS $ms" ;
- my $filename = "abcde";
- my $lex = new LexFile($filename) ;
+ my $lex = new LexFile(my $filename) ;
my $fh = new IO::File ">$filename";
ok &$Func("<$tmpDir1/a*.tmp>" => $fh,
@@ -1399,25 +1395,23 @@ sub run
my $Func = getTopFuncRef($bit);
my $TopType = getTopFuncName($bit);
- my $tmpDir1 = 'tmpdir1';
- my $tmpDir2 = 'tmpdir2';
+ my $tmpDir1 ;
+ my $tmpDir2 ;
my $lex = new LexDir($tmpDir1, $tmpDir2) ;
-
- mkdir $tmpDir1, 0777;
- mkdir $tmpDir2, 0777;
+ my $d1 = quotemeta $tmpDir1 ;
+ my $d2 = quotemeta $tmpDir2 ;
my @opts = ();
@opts = (RawInflate => 1, UnLzma => 1)
if $bit eq 'IO::Uncompress::AnyUncompress';
ok -d $tmpDir1, " Temp Directory $tmpDir1 exists";
- #ok ! -d $tmpDir2, " Temp Directory $tmpDir2 does not exist";
my @files = map { "$tmpDir1/$_.tmp" } qw( a1 a2 a3) ;
foreach (@files) { writeFile($_, compressBuffer($UncompressClass, "abc $_")) }
my @expected = map { "abc $_" } @files ;
- my @outFiles = map { s/$tmpDir1/$tmpDir2/; $_ } @files ;
+ my @outFiles = map { s/$d1/$tmpDir2/; $_ } @files ;
{
title "$TopType - From FileGlob to FileGlob" ;
@@ -1475,8 +1469,7 @@ sub run
{
title "$TopType - From FileGlob to Filehandle" ;
- my $output = 'abc' ;
- my $lex = new LexFile $output ;
+ my $lex = new LexFile my $output ;
my $fh = new IO::File ">$output" ;
ok &$Func("<$tmpDir1/a*.tmp>" => $fh, AutoClose => 1, @opts), ' UnCompressed ok'
or diag $$Error ;