6 use File::Temp qw(tempdir);
10 # This test skipping should be removed when the Cygwin bug is fixed.
11 plan skip_all => "getcwd() fails to fail on Cygwin [perl #132733]";
14 my $tmp = tempdir(CLEANUP => 1);
15 unless(mkdir("$tmp/testdir") && chdir("$tmp/testdir") && rmdir("$tmp/testdir")){
16 plan skip_all => "can't be in non-existent directory";
22 foreach my $type (qw(regular perl)) {
24 skip "_perl_abs_path() not expected to work", 4
26 !(($Config{prefix} =~ m/\//) && $^O ne "cygwin");
28 skip "getcwd() doesn't fail on non-existent directories on this platform", 4
29 if $type eq 'regular' && $^O eq 'dragonfly';
31 no warnings "redefine";
32 local *Cwd::abs_path = \&Cwd::_perl_abs_path if $type eq "perl";
33 local *Cwd::getcwd = \&Cwd::_perl_getcwd if $type eq "perl";
38 is $res, undef, "$type getcwd result on non-existent directory";
39 is $eno, ENOENT, "$type getcwd errno on non-existent directory";
41 $res = Cwd::abs_path(".");
43 is $res, undef, "$type abs_path result on non-existent directory";
44 is $eno, ENOENT, "$type abs_path errno on non-existent directory";
48 chdir $tmp or die "$tmp: $!";