On Fri, 25 Jan 2019, Andy Bradford wrote:

> Thus said "Todd C. Miller" on Thu, 24 Jan 2019 10:06:59 -0700:
> 
> > On 24 Jan 2019 08:19:00 -0700,  "Andy Bradford" wrote: > It looks like
> > currently if  -A is  used the  Friday handling is  > disabled,  so the
> > following patch also disables it when -B is used.
> >
> > I think that's the correct approach.
> 
> ? after.out
> ? before.out
> ? beforeafter.in
> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/src/regress/usr.bin/calendar/Makefile,v
> retrieving revision 1.2
> diff -u -p -r1.2 Makefile
> --- Makefile  14 Sep 2016 16:11:54 -0000      1.2
> +++ Makefile  25 Jan 2019 15:18:56 -0000
> @@ -1,6 +1,6 @@
>  #    $OpenBSD: Makefile,v 1.2 2016/09/14 16:11:54 tb Exp $
>  
> -FILES?!=     ls ${.CURDIR}/*.out
> +FILES?!=     ls ${.CURDIR}/[0-9]*.out
>  
>  CALENDAR?=   calendar
>  IN=          ${.CURDIR}/in
> @@ -14,6 +14,16 @@ ${f:C|.*/||}:
>       @echo ${*}
>       @${CALENDAR} -f ${IN} -t ${f:C|.*/||:C/\..*//} | diff -u ${OUT} -
>  .endfor
> +
> +REGRESS_TARGETS+=before after
> +
> +before:
> +     @echo ${*}
> +     @${CALENDAR} -f ${.CURDIR}/beforeafter.in -t 20190109 -B 5 | diff -U 7 
> ${.CURDIR}/before.out -
> +
> +after:
> +     @echo ${*}
> +     @${CALENDAR} -f ${.CURDIR}/beforeafter.in -t 20190109 -A 2 | diff -U 7 
> ${.CURDIR}/after.out -
>  
>  .PHONY:      ${REGRESS_TARGETS}
>  
> 
> Here is beforeafter.in:
> 
> Sunday        Sunday
> Monday        Monday
> Tuesday       Tuesday
> Wednesday     Wednesday
> Thursday      Thursday
> Friday        Friday
> Saturday      Saturday
> 
> Here is before.out:
> 
> Jan 04*       Friday
> Jan 05*       Saturday
> Jan 06*       Sunday
> Jan 07*       Monday
> Jan 08*       Tuesday
> Jan 09*       Wednesday
> 
> And here is after.out:
> 
> Jan 09*       Wednesday
> Jan 10*       Thursday
> Jan 11*       Friday
> 
> 
> Thanks,

Using your files beforeafter.in, before.out and after.out (copy/pasted), 
regression pass for before but not after. Did you paste the correct file 
after.out?

using `calendar -f beforeafter.in -t 20190111 -A 5` I get a very different 
result than yours:

Jan 11* Friday
Jan 12* Saturday
Jan 13* Sunday
Jan 14* Monday
Jan 15* Tuesday
Jan 16* Wednesday

Instead of copy/pasting text, you can use cvs to make a diff including new 
files as in:

    cvs add beforeafter.in before.out after.out

Reply via email to