Remove duplicately applied patch shards.
[p5sagit/p5-mst-13.2.git] / t / lib / ftmp-security.t
index a3849bd..d31cc9e 100755 (executable)
@@ -1,14 +1,18 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl -w
 # Test for File::Temp - Security levels
 
 # Some of the security checking will not work on all platforms
 # Test a simple open in the cwd and tmpdir foreach of the
 # security levels
 
-use strict;
-use Test;
-BEGIN { plan tests => 13}
+BEGIN {
+       chdir 't' if -d 't';
+       unshift @INC, '../lib';
+       require Test; import Test;
+       plan(tests => 13);
+}
 
+use strict;
 use File::Spec;
 
 # Set up END block - this needs to happen before we load
@@ -21,7 +25,7 @@ use File::Temp qw/ tempfile unlink0 /;
 ok(1);
 
 # The high security tests must currently be skipped on Windows
-my $skipplat = ( $^O eq 'MSWin32' ? 1 : 0 );
+my $skipplat = ( ($^O eq 'MSWin32' || $^O eq 'os2') ? 1 : 0 );
 
 # Can not run high security tests in perls before 5.6.0
 my $skipperl  = ($] < 5.006 ? 1 : 0 );
@@ -78,20 +82,20 @@ sub test_security {
   # of tests -- we dont use skip since the tempfile() commands will
   # fail with MEDIUM/HIGH security before the skip() command would be run
   if ($skip) {
-    
+
     skip($skip,1);
     skip($skip,1);
-    
+
     # plus we need an end block so the tests come out in the right order
     eval q{ END { skip($skip,1); skip($skip,1)  } 1; } || die;
-    
+
     return;
   }
 
   # Create the tempfile
   my $template = "temptestXXXXXXXX";
   my ($fh1, $fname1) = tempfile ( $template, 
-                                 DIR => File::Spec->curdir,
+                                 DIR => File::Spec->tmpdir,
                                  UNLINK => 1,
                                );
   print "# Fname1 = $fname1\n";