diff options
author | Jess Robinson <castaway@desert-island.me.uk> | 2013-04-19 12:02:19 +0100 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-26 14:44:22 -0300 |
commit | b844a53a7d234f06bcf81ebea25299efc781c526 (patch) | |
tree | 7283285a573ca635ef8bb4c2393275fd5b1edfdc /t | |
parent | 43b08d7455517963d64d4aafd3b9b47708446264 (diff) | |
download | perl-b844a53a7d234f06bcf81ebea25299efc781c526.tar.gz |
Adjust fs test to try more ways of getting the CWD. Expire if we still didn't get it.
Diffstat (limited to 't')
-rw-r--r-- | t/io/fs.t | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -16,11 +16,16 @@ if (($^O eq 'MSWin32') || ($^O eq 'NetWare')) { elsif ($^O eq 'VMS') { $wd = `show default`; } +elsif ($ENV{PWD}) { + $wd = $ENV{PWD}; +} else { $wd = `pwd`; } chomp($wd); +die "Can't get current working directory" if(!$wd); + my $has_link = $Config{d_link}; my $accurate_timestamps = !($^O eq 'MSWin32' || $^O eq 'NetWare' || @@ -307,7 +312,7 @@ is(unlink('b'), 1, "unlink b"); is($ino, undef, "ino of unlinked file b should be undef"); unlink 'c'; -chdir $wd || die "Can't cd back to $wd"; +chdir $wd || die "Can't cd back to '$wd' ($!)"; # Yet another way to look for links (perhaps those that cannot be # created by perl?). Hopefully there is an ls utility in your |