Re: CVS commit: src/tests/lib/libutil

2015-12-31 Thread Greg Troxel

"David A. Holland"  writes:

> Module Name:  src
> Committed By: dholland
> Date: Thu Dec 31 10:18:00 UTC 2015
>
> Modified Files:
>   src/tests/lib/libutil: t_parsedate.c
>
> Log Message:
> When evaluated on a Sunday, "next Sunday" means 7 days in the future,
> not 14. When evaluated on a Monday, it apparently means 13 days in the
> future. There's not exactly a spec for parsedate.y, so conform to the
> implementation.
>
> PR 50574.
>
> XXX: to me at least this is an odd notion of "next Sunday", but whatever...

It's clearly a bug.

On a Monday, "next Sunday" is 6 days away.  "Sunday week" is 13.

So perhaps the test should be correct, and the implementation fixed.



signature.asc
Description: PGP signature


Re: CVS commit: src/tests/lib/libutil

2015-12-31 Thread David Holland
On Thu, Dec 31, 2015 at 04:14:52PM -0500, Greg Troxel wrote:
 > > When evaluated on a Sunday, "next Sunday" means 7 days in the future,
 > > not 14. When evaluated on a Monday, it apparently means 13 days in the
 > > future. There's not exactly a spec for parsedate.y, so conform to the
 > > implementation.
 > >
 > > PR 50574.
 > >
 > > XXX: to me at least this is an odd notion of "next Sunday", but
 > > whatever...
 > 
 > It's clearly a bug.
 > 
 > On a Monday, "next Sunday" is 6 days away.  "Sunday week" is 13.
 > 
 > So perhaps the test should be correct, and the implementation fixed.

Well, it treats "this Sunday" as 6 days away. It apparently thinks
"this X" is in the next seven days and "next X" is the week past that.

That is not entirely crazy, though it's not really consistent with the
conventional usage I know... but that usage isn't well defined. On
Monday, "this Sunday" and "next Sunday" are pretty clearly the same
day; but on Saturday, they probably aren't, and it's not clear what
the crossover is.

Meanwhile, these usages are regional. I've never understood the "next
Sunday week" or "this Sunday week" business no matter how many times I
run across it in lit from across the pond.

Anyhow, if you care, I suggest writing a spec for parsedate }:-)

-- 
David A. Holland
dholl...@netbsd.org