BEGIN {
unless(grep /blib/, @INC) {
chdir 't' if -d 't';
- @INC = '../lib' if -d '../lib';
+ @INC = '../lib';
}
require Config; import Config;
if ($] < 5.00326 || not $Config{'d_readdir'}) {
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 <*>;
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 :-)
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