From: Craig A. Berry Date: Wed, 26 Sep 2001 17:43:14 +0000 (-0500) Subject: slightly less broken chdir.t for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d4c144b923f1296fc58dd2230c626ac46cfb312;p=p5sagit%2Fp5-mst-13.2.git slightly less broken chdir.t for VMS Message-Id: <5.1.0.14.0.20010926173048.01aac5b0@exchi01> p4raw-id: //depot/perl@12252 --- diff --git a/iperlsys.h b/iperlsys.h index 298f82a..d3e8254 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -415,7 +415,7 @@ struct IPerlDirInfo #define PerlDir_mkdir(name, mode) Mkdir((name), (mode)) #ifdef VMS -# define PerlDir_chdir(n) Chdir(((n) && *(n)) ? (n) : "SYS$LOGIN") +# define PerlDir_chdir(n) Chdir((n)) #else # define PerlDir_chdir(name) chdir((name)) #endif diff --git a/t/op/chdir.t b/t/op/chdir.t index 23ac735..8386df0 100644 --- a/t/op/chdir.t +++ b/t/op/chdir.t @@ -8,7 +8,7 @@ BEGIN { } require "test.pl"; -plan(tests => 25); +plan(tests => 31); my $IsVMS = $^O eq 'VMS'; @@ -19,14 +19,14 @@ use File::Spec::Functions qw(:DEFAULT splitdir rel2abs); # Can't use Cwd::abs_path() because it has different ideas about # path seperators than File::Spec. sub abs_path { - rel2abs(curdir); + $IsVMS ? uc(rel2abs(curdir)) : rel2abs(curdir); } my $Cwd = abs_path; # Let's get to a known position SKIP: { - skip("Already in t/", 2) if (splitdir(abs_path))[-1] eq 't'; + skip("Already in t/", 2) if (splitdir(abs_path))[-1] eq ($IsVMS ? 'T' : 't'); ok( chdir('t'), 'chdir("t")'); is( abs_path, catdir($Cwd, 't'), ' abs_path() agrees' ); @@ -84,14 +84,14 @@ foreach my $key (@magic_envs) { # We're going to be using undefs a lot here. no warnings 'uninitialized'; - local %ENV = (); - $ENV{$key} = catdir $Cwd, 'op'; + local %ENV = () if !$IsVMS; + $ENV{$key} = catdir $Cwd, ($IsVMS ? 'OP' : 'op'); check_env($key); } { - local %ENV = (); + local %ENV = () if !$IsVMS; ok( !chdir(), 'chdir() w/o any ENV set' ); is( abs_path, $Cwd, ' abs_path() agrees' );