develooper Front page | perl.perl5.porters | Postings from September 2001

[PATCH perl@12239] slightly less broken chdir.t for VMS

Thread Next
From:
Craig A. Berry
Date:
September 26, 2001 15:47
Subject:
[PATCH perl@12239] slightly less broken chdir.t for VMS
Message ID:
5.1.0.14.0.20010926173048.01aac5b0@exchi01
This gets us to pass 29/31 tests (all but #30) instead of zero.  We probably 
need some alternative to destroying the entire environment hash (which is 
illegal on VMS), but I may not get a chance to pursue this further for a bit.

--- iperlsys.h;-0       Wed Sep  5 23:00:32 2001
+++ iperlsys.h  Wed Sep 26 15:42:25 2001
@@ -415,7 +415,7 @@
 
 #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
--- t/op/chdir.t;-0     Tue Sep 25 13:02:27 2001
+++ t/op/chdir.t        Wed Sep 26 17:29:32 2001
@@ -8,7 +8,7 @@
 }
 
 require "test.pl";
-plan(tests => 25);
+plan(tests => 31);
 
 my $IsVMS = $^O eq 'VMS';
 
@@ -19,14 +19,14 @@
 # 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 @@
     # 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' );

[end of patch]


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About