slightly less broken chdir.t for VMS
authorCraig A. Berry <craigberry@mac.com>
Wed, 26 Sep 2001 17:43:14 +0000 (12:43 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 27 Sep 2001 22:46:42 +0000 (22:46 +0000)
Message-Id: <5.1.0.14.0.20010926173048.01aac5b0@exchi01>

p4raw-id: //depot/perl@12252

iperlsys.h
t/op/chdir.t

index 298f82a..d3e8254 100644 (file)
@@ -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
index 23ac735..8386df0 100644 (file)
@@ -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' );