[RESEND] [PATCH] Mac OS lib patches for bleadperl
[p5sagit/p5-mst-13.2.git] / t / lib / io_dir.t
index 11ec8bc..6ec4e9f 100755 (executable)
@@ -3,7 +3,7 @@
 BEGIN {
     unless(grep /blib/, @INC) {
         chdir 't' if -d 't';
-        unshift @INC, '../lib' if -d '../lib';
+        @INC = '../lib';
     }
     require Config; import Config;
     if ($] < 5.00326 || not $Config{'d_readdir'}) {
@@ -19,7 +19,9 @@ use IO::Dir qw(DIR_UNLINK);
 
 print "1..10\n";
 
-$dot = new IO::Dir ".";
+my $DIR = $^O eq 'MacOS' ? ":" : ".";
+
+$dot = new IO::Dir $DIR;
 print defined($dot) ? "ok" : "not ok", " 1\n";
 
 @a = sort <*>;
@@ -41,7 +43,7 @@ open(FH,'>X') || die "Can't create x";
 print FH "X";
 close(FH);
 
-tie %dir, IO::Dir, ".";
+tie %dir, IO::Dir, $DIR;
 my @files = keys %dir;
 
 # I hope we do not have an empty dir :-)
@@ -55,7 +57,7 @@ delete $dir{'X'};
 
 print -f 'X' ? "ok" : "not ok", " 8\n";
 
-tie %dirx, IO::Dir, ".", DIR_UNLINK;
+tie %dirx, IO::Dir, $DIR, DIR_UNLINK;
 
 my $statx = $dirx{'X'};
 print defined($statx) && UNIVERSAL::isa($statx,'File::stat') && $statx->size == 1