6 use File::Temp qw(tempdir);
9 my $tmp = tempdir(CLEANUP => 1);
10 unless(mkdir("$tmp/testdir") && chdir("$tmp/testdir") && rmdir("$tmp/testdir")){
11 plan skip_all => "can't be in non-existent directory";
15 my $EXTRA_ABSPATH_TESTS = ($Config{prefix} =~ m/\//) && $^O ne 'cygwin';
18 foreach my $type (qw(regular perl)) {
20 skip "_perl_abs_path() not expected to work", 4
22 !(($Config{prefix} =~ m/\//) && $^O ne "cygwin");
23 no warnings "redefine";
24 local *Cwd::abs_path = \&Cwd::_perl_abs_path if $type eq "perl";
25 local *Cwd::getcwd = \&Cwd::_perl_getcwd if $type eq "perl";
30 is $res, undef, "$type getcwd result on non-existent directory";
31 is $eno, ENOENT, "$type getcwd errno on non-existent directory";
33 $res = Cwd::abs_path(".");
35 is $res, undef, "$type abs_path result on non-existent directory";
36 is $eno, ENOENT, "$type abs_path errno on non-existent directory";
40 chdir $tmp or die "$tmp: $!";