Don't require to have at least DB_File or *DBM_File
[p5sagit/p5-mst-13.2.git] / t / lib / compress / oneshot.pl
index 64588c2..0646958 100644 (file)
@@ -51,7 +51,7 @@ sub run
         like $@, mkErr("^$TopType: unknown key value\\(s\\) Fred"), '  Illegal Parameters';
 
         eval { $a = $Func->() ;} ;
-        like $@, mkErr("^$TopType: expected at least 1 parameters"), '  No Parameters';
+        like $@, "/^$TopType: expected at least 1 parameters/", '  No Parameters';
 
         eval { $a = $Func->(\$x, \1) ;} ;
         like $$Error, "/^$TopType: output buffer is read-only/", '  Output is read-only' ;
@@ -95,14 +95,24 @@ sub run
         like $@, mkErr("^$TopType: input and output buffer are identical"),
             '  Input and Output buffer are the same';
             
-        my $lex = new LexFile my $out_file ;
-        open OUT, ">$out_file" ;
-        eval { $a = $Func->(\*OUT, \*OUT) ;} ;
-        like $@, mkErr("^$TopType: input and output handle are identical"),
-            '  Input and Output handle are the same';
-            
-        close OUT;
-        is -s $out_file, 0, "  File zero length" ;
+        SKIP:
+        {
+            # Threaded 5.6.x seems to have a problem comparing filehandles.
+            use Config;
+
+            skip 'Cannot compare filehandles with threaded $]', 2
+                if $] >= 5.006  && $] < 5.007 && $Config{useithreads};
+
+            my $lex = new LexFile my $out_file ;
+            open OUT, ">$out_file" ;
+            eval { $a = $Func->(\*OUT, \*OUT) ;} ;
+            like $@, mkErr("^$TopType: input and output handle are identical"),
+                '  Input and Output handle are the same';
+                
+            close OUT;
+            is -s $out_file, 0, "  File zero length" ;
+        }
+
         {
             my %x = () ;
             my $object = bless \%x, "someClass" ;
@@ -165,9 +175,18 @@ sub run
             my $out ;
             my @x ;
 
-            eval { $a = $Func->(\$in, \$out, TrailingData => \"abc") ;} ;
-            like $@, mkErr("^$TopType: Parameter 'TrailingData' not writable"),
-                '  TrailingData output not writable';
+            SKIP:
+            {
+                use Config;
+
+                skip 'readonly + threads', 1
+                    if $Config{useithreads};
+
+                
+                eval { $a = $Func->(\$in, \$out, TrailingData => \"abc") ;} ;
+                like $@, mkErr("^$TopType: Parameter 'TrailingData' not writable"),
+                    '  TrailingData output not writable';
+            }
 
             eval { $a = $Func->(\$in, \$out, TrailingData => \@x) ;} ;
             like $@, mkErr("^$TopType: Parameter 'TrailingData' not a scalar reference"),