From: Nick Ing-Simmons Date: Fri, 30 Mar 2001 14:47:10 +0000 (+0000) Subject: Should be (^O eq 'MSWin32') not 'Win32' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=14107c4230ff0dd854afb28ea983f6afcb4bfac1;p=p5sagit%2Fp5-mst-13.2.git Should be (^O eq 'MSWin32') not 'Win32' Fail #12 seems real - chdir is in wrong dir. p4raw-id: //depot/perlio@9471 --- diff --git a/t/lib/cwd.t b/t/lib/cwd.t index d2c3944..fa4750e 100644 --- a/t/lib/cwd.t +++ b/t/lib/cwd.t @@ -26,11 +26,13 @@ print +(!defined(&chdir) && # Must find an external pwd (or equivalent) command. my $pwd_cmd = - ($^O eq "Win32") ? "cd" : (grep { -x && -f } map { "$_/pwd" } + ($^O eq "MSWin32") ? "cd" : (grep { -x && -f } map { "$_/pwd" } split m/$Config{path_sep}/, $ENV{PATH})[0]; if (defined $pwd_cmd) { chomp(my $start = `$pwd_cmd`); + # Win32's cd returns native C:\ style + $start =~ s,\\,/,g if $^O eq 'MSWin32'; if ($?) { for (3..6) { print "ok $_ # Skip: '$pwd_cmd' failed\n"; @@ -68,12 +70,18 @@ print +($fastcwd =~ m|$want$| ? "" : "not "), "ok 9\n"; print +($fastgetcwd =~ m|$want$| ? "" : "not "), "ok 10\n"; # Cwd::chdir should also update $ENV{PWD} +print "#$ENV{PWD}\n"; print +($ENV{PWD} =~ m|$want$| ? "" : "not "), "ok 11\n"; Cwd::chdir ".."; rmdir "dir"; +print "#$ENV{PWD}\n"; Cwd::chdir ".."; rmdir "a"; +print "#$ENV{PWD}\n"; Cwd::chdir ".."; rmdir "to"; +print "#$ENV{PWD}\n"; Cwd::chdir ".."; rmdir "path"; +print "#$ENV{PWD}\n"; Cwd::chdir ".."; rmdir "pteerslt"; +print "#$ENV{PWD}\n"; print +($ENV{PWD} =~ m|\bt$| ? "" : "not "), "ok 12\n"; if ($Config{d_symlink}) {