Remove duplicately applied patch shards.
[p5sagit/p5-mst-13.2.git] / t / lib / st-forgive.t
index 1cce7c7..822013b 100644 (file)
 sub BEGIN {
     chdir('t') if -d 't';
     unshift @INC, '../lib';
+    require Config; import Config;
+    if ($Config{'extensions'} !~ /\bStorable\b/) {
+        print "1..0 # Skip: Storable was not built\n";
+        exit 0;
+    }
 }
 
 use Storable qw(store retrieve);
+use File::Spec;
 
 print "1..8\n";
 
@@ -37,8 +43,10 @@ print (($@ ne '')?"ok $test\n":"not ok $test\n"); $test++;
 
 $Storable::forgive_me=1;
 
+my $devnull = File::Spec->devnull;
+
 open(SAVEERR, ">&STDERR");
-open(STDERR, ">/dev/null") or 
+open(STDERR, ">$devnull") or 
   ( print SAVEERR "Unable to redirect STDERR: $!\n" and exit(1) );
 
 eval {$result = store ($bad , 'store')};
@@ -55,4 +63,4 @@ print (($ret->[2] eq 'bar')?"ok $test\n":"not ok $test\n"); $test++;
 print ((ref $ret->[1] eq 'SCALAR')?"ok $test\n":"not ok $test\n"); $test++;
 
 
-END { unlink 'store' }
+END { 1 while unlink 'store' }