On Mon Feb 29 02:41:32 2016, SREZIC wrote:
> ... and this happens every leap day, it seems:
> $ perl -MTime::Local=timelocal -e 'warn timelocal(0,0,12,29,2-1,2020)'
> 1582977600 at -e line 1.
> $ perl5.22.1 -MTime::Fake=1582977600 -Mblib t/date.t
> not ok 61 # 1999 10:02:18 "GMT"
I think the test in question is incorrect. It's trying to parse the string as a date, filling in the month and day (but not the year) from today's date whenever it gets run, but setting the year to 1999. This will fail on every leap day, because no such date exists in 1999.
Picking any leap year as the year will make this pass; see the attached patch, which uses 2000.
The text was updated successfully, but these errors were encountered:
Fixes GH #33
This test tries to build a date from the hard-coded year 1999, and the month
and day of the date it gets run. This will always fail on February 29th.
Hard-coding a leap year instead of 1999 fixes the problem.
(cherry picked from commit f7165548fcc818214699fe499e14b61aa621d380)
Signed-off-by: Nicolas R <firstname.lastname@example.org>