[Koha-bugs] [Bug 14113] Silence warnings t/Date.t

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 22 14:23:20 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14113

--- Comment #5 from Jonathan Druart <jonathan.druart at biblibre.com> ---
(In reply to M. Tompsett from comment #4)
> (In reply to Jonathan Druart from comment #3)
> > Comment on attachment 38904 [details] [review] [review]
> > [SIGNED-OFF] Bug 14113: Silence t/Dates.t warnings and cleanup output.
> > 
> > Review of attachment 38904 [details] [review] [review]:
> > -----------------------------------------------------------------
> > 
> > ::: t/Dates.t
> > @@ +59,3 @@
> > >  foreach ( @{ $thash{'iso'} } ) {
> > > +    if ($_ =~ /1952/) {
> > > +        warning_like { $val = format_date($_); } qr/Illegal date/,
> > 
> > This is confusing I think.
> > The date is not illegal because it contains 1952, but because the day or
> > month is 0.
> 
> Yes, but of the dates in the hash, the only illegal dates have 1952 as the
> year.

Yes I understood, but it's confusing :)

> > Maybe should we test all cases (list all the illegal dates), or be explicit
> > somewhere.
> 
> I didn't want to restructure code. I suppose if we broke the dates into
> legal and illegal dates and did the same loop twice that would be okay?

What about checking /^00?-/, /-0?0$/ and /0{4}$/ ?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list