Subject: | Date::Holidays::EnglandWales suffers from a 2038 problem |
perl -MDate::Holidays::EnglandWales -e 'is_uk_holiday(2038, "06", "01")'
Returns:
Day too big - 24988 > 24855
Sec too small - 24988 < 74752
Sec too big - 24988 > 11647
Cannot handle date (0, 0, 0, 1, 5, 2038) at
/export/home/netbanx/base/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Time/Piece.pm
line 315
This happens with Time::Piece 1.15.
With Time::Piece 1.20 I see a different problem: the module thinks
every day is a bank holiday:
perl -MDate::Holidays::EnglandWales -e 'print "CELEBRATE!\n" if
is_uk_holiday(2010, "05", "01")'
garbage at end of string in strptime: 2010-5-1 at
/export/home/netbanx/base/usr/lib/perl5/5.10.1/i686-linux/Time/Piece.pm
line 469.
CELEBRATE!
The test suite doesn't catch these problems because it only checks that
the module compiles. You also might want to add some test cases like this:
ok ! is_uk_holiday(2010, 6, 1);
ok is_uk_holiday(2010, 12, 27);
ok ! is_uk_holiday(2038, 6, 3);
Finally, I notice the PREREQ_PM in Makefile.PL contains a hashref with a
list of module names instead of the required list of key/value pairs
containing module names and minimum required versions (or undef if you
don't care about version numbers).
Tom