diff options
author | Craig A. Berry <craigberry@mac.com> | 2003-03-25 16:52:58 -0600 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2003-03-26 13:13:23 +0000 |
commit | fb73e4b8378c5f88df40902cdf15acb7d06dab77 (patch) | |
tree | 9f315171481692f01dba8af3c558d014241f4fc4 | |
parent | 60d790016f9a602e57865a57da59741adc77fbe4 (diff) | |
download | perl-fb73e4b8378c5f88df40902cdf15acb7d06dab77.tar.gz |
lib/vmsish.t GMT bug fix
From: "Craig A. Berry" <craigberry@mac.com>
Message-ID: <3E81322A.3040508@mac.com>
p4raw-id: //depot/perl@19060
-rw-r--r-- | lib/vmsish.t | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/vmsish.t b/lib/vmsish.t index 24e3b041ea..ff3f5b5e06 100644 --- a/lib/vmsish.t +++ b/lib/vmsish.t @@ -114,6 +114,10 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); } { use_ok('vmsish qw(time)'); + + # but that didn't get it in our current scope + use vmsish qw(time); + $vmstime = time; @vmslocal = localtime($vmstime); @vmsgmtime = gmtime($vmstime); @@ -130,23 +134,23 @@ is($?,0,"outer lex scope of vmsish [POSIX status]"); # since it's unlikely local time will differ from UTC by so small # an amount, and it renders the test resistant to delays from # things like stat() on a file mounted over a slow network link. - ok($utctime - $vmstime +$offset <= 10,"(time) UTC:$utctime VMS:$vmstime"); + ok(abs($utctime - $vmstime + $offset) <= 10,"(time) UTC: $utctime VMS: $vmstime"); $utcval = $utclocal[5] * 31536000 + $utclocal[7] * 86400 + $utclocal[2] * 3600 + $utclocal[1] * 60 + $utclocal[0]; $vmsval = $vmslocal[5] * 31536000 + $vmslocal[7] * 86400 + $vmslocal[2] * 3600 + $vmslocal[1] * 60 + $vmslocal[0]; - ok($vmsval - $utcval + $offset <= 10, "(localtime)"); + ok(abs($vmsval - $utcval + $offset) <= 10, "(localtime) UTC: $utcval VMS: $vmsval"); print "# UTC: @utclocal\n# VMS: @vmslocal\n"; $utcval = $utcgmtime[5] * 31536000 + $utcgmtime[7] * 86400 + $utcgmtime[2] * 3600 + $utcgmtime[1] * 60 + $utcgmtime[0]; $vmsval = $vmsgmtime[5] * 31536000 + $vmsgmtime[7] * 86400 + $vmsgmtime[2] * 3600 + $vmsgmtime[1] * 60 + $vmsgmtime[0]; - ok($vmsval - $utcval + $offset <= 10, "(gmtime)"); + ok(abs($vmsval - $utcval + $offset) <= 10, "(gmtime) UTC: $utcval VMS: $vmsval"); print "# UTC: @utcgmtime\n# VMS: @vmsgmtime\n"; - ok($vmsmtime - $utcmtime + $offset <= 10,"(stat) UTC: $utcmtime VMS: $vmsmtime"); + ok(abs($utcmtime - $vmsmtime + $offset) <= 10,"(stat) UTC: $utcmtime VMS: $vmsmtime"); } } |