summaryrefslogtreecommitdiff
path: root/cpan/IO-Compress/t
diff options
context:
space:
mode:
authorPaul Marquess <Paul.Marquess@btinternet.com>2009-10-09 22:51:37 +0100
committerSteve Hay <SteveHay@planit.com>2009-11-14 00:11:42 +0000
commit1725f55ba78fb58489ea39e2bc0cc1faffd32275 (patch)
tree9c50ac3f9f830cc3504ec99e8397237d79cb81ad /cpan/IO-Compress/t
parent364d54baf6add9c4667b89e1656f226d0882a843 (diff)
downloadperl-1725f55ba78fb58489ea39e2bc0cc1faffd32275.tar.gz
[PATCH] IO-Compress 2.022
Message-ID: <4ACFB129.9070900@btinternet.com>
Diffstat (limited to 'cpan/IO-Compress/t')
-rw-r--r--cpan/IO-Compress/t/01misc.t11
-rw-r--r--cpan/IO-Compress/t/compress/CompTestUtils.pm6
-rw-r--r--cpan/IO-Compress/t/compress/any.pl2
-rw-r--r--cpan/IO-Compress/t/compress/oneshot.pl10
-rw-r--r--cpan/IO-Compress/t/compress/truncate.pl2
5 files changed, 19 insertions, 12 deletions
diff --git a/cpan/IO-Compress/t/01misc.t b/cpan/IO-Compress/t/01misc.t
index a7a31fbe15..85cfd37902 100644
--- a/cpan/IO-Compress/t/01misc.t
+++ b/cpan/IO-Compress/t/01misc.t
@@ -86,11 +86,14 @@ sub My::testParseParameters()
like $@, mkErr("Parameter 'Fred' not a scalar"),
"wanted scalar";
- #eval { ParseParameters(1, {'Fred' => [1, 1, Parse_any|Parse_multiple, 0]}, Fred => 1, Fred => 2) ; };
- #like $@, mkErr("Muliple instances of 'Fred' found"),
- #"wanted scalar";
+# eval { ParseParameters(1, {'Fred' => [1, 1, Parse_any, 0]}, Fred => 1, Fred => 2) ; };
+# like $@, mkErr("Muliple instances of 'Fred' found"),
+# "wanted scalar";
- ok 1;
+ my $g = ParseParameters(1, {'Fred' => [1, 1, Parse_unsigned|Parse_multiple, 7]}, Fred => 1, Fred => 2) ;
+ is_deeply $g->value('Fred'), [ 1, 2 ] ;
+
+ #ok 1;
my $got = ParseParameters(1, {'Fred' => [1, 1, 0x1000000, 0]}, Fred => 'abc') ;
is $got->value('Fred'), "abc", "other" ;
diff --git a/cpan/IO-Compress/t/compress/CompTestUtils.pm b/cpan/IO-Compress/t/compress/CompTestUtils.pm
index cb63d6274c..c5452b6b13 100644
--- a/cpan/IO-Compress/t/compress/CompTestUtils.pm
+++ b/cpan/IO-Compress/t/compress/CompTestUtils.pm
@@ -16,7 +16,7 @@ use Carp ;
sub title
{
#diag "" ;
- ok 1, $_[0] ;
+ ok(1, $_[0]) ;
#diag "" ;
}
@@ -476,6 +476,7 @@ sub anyUncompress
Append => 1,
Transparent => 0,
RawInflate => 1,
+ #UnLzma => 1,
@opts
or croak "Cannot open buffer/file: $AnyUncompressError" ;
@@ -537,6 +538,7 @@ sub getHeaders
Append => 1,
Transparent => 0,
RawInflate => 1,
+ #UnLzma => 1,
@opts
or croak "Cannot open buffer/file: $AnyUncompressError" ;
@@ -647,7 +649,7 @@ sub getMultiValues
{
my $class = shift ;
- return (0,0) if $class =~ /lzf/i;
+ return (0,0) if $class =~ /lzf|lzma/i;
return (1,0);
}
diff --git a/cpan/IO-Compress/t/compress/any.pl b/cpan/IO-Compress/t/compress/any.pl
index d95766b0a9..23a23295aa 100644
--- a/cpan/IO-Compress/t/compress/any.pl
+++ b/cpan/IO-Compress/t/compress/any.pl
@@ -57,6 +57,7 @@ sub run
{
my $unc = new $AnyConstruct $input, Transparent => $trans,
RawInflate => 1,
+ #UnLzma => 1,
Append => 1 ;
ok $unc, " Created $AnyClass object"
@@ -76,6 +77,7 @@ sub run
{
my $unc = new $AnyConstruct $input, Transparent => $trans,
RawInflate => 1,
+ #UnLzma => 1,
Append => 1 ;
ok $unc, " Created $AnyClass object"
diff --git a/cpan/IO-Compress/t/compress/oneshot.pl b/cpan/IO-Compress/t/compress/oneshot.pl
index 9c76cefdb5..78d17275b7 100644
--- a/cpan/IO-Compress/t/compress/oneshot.pl
+++ b/cpan/IO-Compress/t/compress/oneshot.pl
@@ -276,7 +276,7 @@ sub run
my $FuncInverse = getTopFuncRef($TopTypeInverse);
my @opts = ();
- @opts = (RawInflate => 1)
+ @opts = (RawInflate => 1, UnLzma => 1)
if $CompressClass eq 'IO::Compress::RawInflate';
for my $append ( 1, 0 )
@@ -615,7 +615,7 @@ sub run
{
title "Truncated file";
skip '', 7
- if $CompressClass =~ /lzop|lzf/i ;
+ if $CompressClass =~ /lzop|lzf|lzma/i ;
my @in ;
push @in, "abcde" x 10;
@@ -1020,7 +1020,7 @@ sub run
my $incumbent = "incumbent data" ;
my @opts = (Strict => 1);
- push @opts, (RawInflate => 1)
+ push @opts, (RawInflate => 1, UnLzma => 1)
if $bit eq 'IO::Uncompress::AnyUncompress';
for my $append (0, 1)
@@ -1321,7 +1321,7 @@ sub run
my $keep_comp = $comp;
my @opts = ();
- @opts = (RawInflate => 1)
+ @opts = (RawInflate => 1, UnLzma => 1)
if $bit eq 'IO::Uncompress::AnyUncompress';
my $incumbent = "incumbent data" ;
@@ -1407,7 +1407,7 @@ sub run
mkdir $tmpDir2, 0777;
my @opts = ();
- @opts = (RawInflate => 1)
+ @opts = (RawInflate => 1, UnLzma => 1)
if $bit eq 'IO::Uncompress::AnyUncompress';
ok -d $tmpDir1, " Temp Directory $tmpDir1 exists";
diff --git a/cpan/IO-Compress/t/compress/truncate.pl b/cpan/IO-Compress/t/compress/truncate.pl
index b362fd3b6e..063355b519 100644
--- a/cpan/IO-Compress/t/compress/truncate.pl
+++ b/cpan/IO-Compress/t/compress/truncate.pl
@@ -64,7 +64,7 @@ sub run
ok $gz;
ok ! $gz->error() ;
my $buff ;
- is $gz->read($buff), length($part) ;
+ is $gz->read($buff, 5000), length($part) ;
ok $buff eq $part ;
ok $gz->eof() ;
$gz->close();