From: John E. Malmberg Date: Thu, 16 Aug 2007 00:27:35 +0000 (-0500) Subject: [patch@31706]01_module_load_conditional.t fix for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd9d6e12c89be8a020547894530d010bc57853e4;p=p5sagit%2Fp5-mst-13.2.git [patch@31706]01_module_load_conditional.t fix for VMS From: "John E. Malmberg" Message-id: <46C3E047.4010001@qsl.net> p4raw-link: @31706 on //depot/perl: a1ccf0c4149bb99ed14901ae02b811f242bba527 p4raw-id: //depot/perl@31726 --- diff --git a/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t b/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t index 2dc249f..c741678 100644 --- a/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t +++ b/lib/Module/Load/Conditional/t/01_Module_Load_Conditional.t @@ -43,8 +43,24 @@ use_ok( 'Module::Load::Conditional' ); 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 @@ SKIP:{ { 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 ); @@ -164,4 +181,3 @@ SKIP:{ ' can_load successful' ); } -