Fixes for this test to pass on VMS.

For test 4:

The test is expecting the returned file to be in UNIX syntax.

Change to use splitpath as is more portable than splitdir when a path contains more than directories.

On VMS use UNIX splitpath as VMS splitpath converts the result back to VMS format with UNIX input, contrary to documentation. There seems to be some other modules that depend on the existing VMS splitpath behavior, so not fixing VMS splitpath at this time.

For test 24, the module filename needs to also be in %INC in VMS format the can_load test to succeed.

-John
[EMAIL PROTECTED]
Personal Opinion Only
--- /rsync_root/perl/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t 
Fri Jan 26 02:30:21 2007
+++ lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t  Thu Aug 16 
00:14:36 2007
@@ -43,8 +43,24 @@
     ok( $rv->{version} == $Module::Load::Conditional::VERSION,  
                             q[  Found proper version] );
 
+    # This test is expecting the file to in UNIX format, so force
+    $rv->{file} = VMS::Filespec::unixify($rv->{file}) if $^O eq 'VMS';
+
+    # break up the specification
+    my @rv_path;
+    if ($^O eq 'VMS') {
+       # Use the UNIX specific method, as the VMS one currently
+       # converts the file spec back to VMS format.
+       @rv_path = File::Spec::Unix->splitpath($rv->{file});
+    } else {
+       @rv_path = File::Spec->splitpath($rv->{file});
+    }
+
+    # First element could be blank for some system types like VMS
+    shift @rv_path if $rv_path[0] eq '';
+
     ok( $INC{'Module/Load/Conditional.pm'} eq
-        File::Spec::Unix->catfile(File::Spec->splitdir($rv->{file}) ),
+        File::Spec::Unix->catfile(@rv_path),
                             q[  Found proper file]
     );
 
@@ -152,6 +168,7 @@
     {   package A::B::C::D; 
         $A::B::C::D::VERSION = $$; 
         $INC{'A/B/C/D.pm'}   = $$.$$;
+       $INC{'[.A.B.C]D.pm'} = $$.$$ if $^O eq 'VMS';
     }
     
     my $href = check_install( module => 'A::B::C::D', version => 0 );
@@ -163,5 +180,4 @@
     ok( can_load( modules => { 'A::B::C::D' => 0 } ),
                                 '   can_load successful' );
 }
-
 

Reply via email to