X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvmsish.t;h=847d1a6f3049c0948bd07aa5684752f797e47760;hb=503de4705ff6537018ae94e9179e16636748b2a6;hp=ff3f5b5e063b3b9af9b247971ca3c7e0033630cf;hpb=fb73e4b8378c5f88df40902cdf15acb7d06dab77;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/vmsish.t b/lib/vmsish.t index ff3f5b5..847d1a6 100644 --- a/lib/vmsish.t +++ b/lib/vmsish.t @@ -5,9 +5,12 @@ BEGIN { @INC = '../lib'; } -my $Invoke_Perl = qq(MCR $^X "-I[-.lib]"); +my $perl = $^X; +$perl = VMS::Filespec::vmsify($perl) if $^O eq 'VMS'; -require "./test.pl"; +my $Invoke_Perl = qq(MCR $perl "-I[-.lib]"); + +BEGIN { require "./test.pl"; } plan(tests => 25); SKIP: { @@ -112,6 +115,17 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); eval "END { \$ENV{'SYS\$TIMEZONE_DIFFERENTIAL'} = $oldtz; }"; gmtime(0); # Force reset of tz offset } + + # Unless we are prepared to parse the timezone rules here and figure out + # what the correct offset was when the file was last revised, we need to + # use a file for which the current offset is known to be valid. That's why + # we create a file rather than using an existing one for the stat() test. + + my $file = 'sys$scratch:vmsish_t_flirble.tmp'; + open TMP, ">$file" or die "Couldn't open file $file"; + close TMP; + END { 1 while unlink $file; } + { use_ok('vmsish qw(time)'); @@ -121,12 +135,12 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); $vmstime = time; @vmslocal = localtime($vmstime); @vmsgmtime = gmtime($vmstime); - $vmsmtime = (stat $0)[9]; + $vmsmtime = (stat $file)[9]; } $utctime = time; @utclocal = localtime($vmstime); @utcgmtime = gmtime($vmstime); - $utcmtime = (stat $0)[9]; + $utcmtime = (stat $file)[9]; $offset = $ENV{'SYS$TIMEZONE_DIFFERENTIAL'};