libwww test bug: base/date fails immediately after daylight saving transition
am 28.03.2007 11:27:09 von ste--nextPart2886244.AD5KELmOVI
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello. This is just FYI...
I've just figured out why the libwww-perl tests passed last week but not=20
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=
=20
days in the past. By converting it using localtime() this test is sensitive=
=20
to daylight saving. So this test will fail today, but not tomorrow!
Regards,
Steve James
===3D
# test the 'ls -l' format with missing year$
# round to nearest minute 3 days ago.
$time =3D int((time - 3 * 24*60*60) /60)*60;
($min, $hr, $mday, $mon) =3D (localtime $time)[1,2,3,4];
$mon =3D (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$mon];
$str =3D sprintf("$mon %02d %02d:%02d", $mday, $hr, $min);
$t =3D str2time($str);
$t =3D "UNDEF" unless defined $t;
print "'$str' =3D> $t ($time)\n";
print "not " if $t !=3D $time;
ok;
=2D-=20
You're a card which will have to be dealt with.
--nextPart2886244.AD5KELmOVI
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQBGCjT1GWc6r+MhunERAmCbAJ9+jojNcv1ZCzn1N6iL1gYcJ6GVBgCf RvoD
dRFcJguUzN1E6SU2FZ/8D5M=
=aPHk
-----END PGP SIGNATURE-----
--nextPart2886244.AD5KELmOVI--