libwww test bug: base/date fails immediately after daylight saving transition
Steve James <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Organization | Beach Solutions Ltd |
| Message-ID | <[email protected]> |
Hello. This is just FYI...
I've just figured out why the libwww-perl tests passed last week but not
today: we've just transitioned here into daylight saving (GMT -> BST)
The failing test is in t/base/date.t, below. It uses a reference date three
days in the past. By converting it using localtime() this test is sensitive
to daylight saving. So this test will fail today, but not tomorrow!
Regards,
Steve James
===
# test the 'ls -l' format with missing year$
# round to nearest minute 3 days ago.
$time = int((time - 3 * 24*60*60) /60)*60;
($min, $hr, $mday, $mon) = (localtime $time)[1,2,3,4];
$mon = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$mon];
$str = sprintf("$mon %02d %02d:%02d", $mday, $hr, $min);
$t = str2time($str);
$t = "UNDEF" unless defined $t;
print "'$str' => $t ($time)\n";
print "not " if $t != $time;
ok;
--
You're a card which will have to be dealt with.
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBGCjT1GWc6r+MhunERAmCbAJ9+jojNcv1ZCzn1N6iL1gYcJ6GVBgCfRvoD dRFcJguUzN1E6SU2FZ/8D5M= =aPHk -----END PGP SIGNATURE-----