On Fri, 25 Jan 2019, Andy Bradford wrote:
> Thus said "Andy Bradford" on 25 Jan 2019 08:22:31 -0700:
>
> > Oh and how about some regression:
>
> Oops, here's a corrected patch because the -t for after: was wrong and
> didn't actually correctly test the functionality:
>
> ? 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:34:21 -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 20190111 -A 5 | diff -U 7
> ${.CURDIR}/after.out -
>
> .PHONY: ${REGRESS_TARGETS}
>
>
> Here is the new after.out:
>
> Jan 11* Friday
> Jan 12* Saturday
> Jan 13* Sunday
> Jan 14* Monday
> Jan 15* Tuesday
> Jan 16* Wednesday
>
> Here is the original before.out:
>
> Jan 04* Friday
> Jan 05* Saturday
> Jan 06* Sunday
> Jan 07* Monday
> Jan 08* Tuesday
> Jan 09* Wednesday
>
> Thanks,
>
> Andy
> --
> TAI64 timestamp: 400000005c4b2dd0
>
>
>
Thank you for fixing this issue. With the patched version, I confirm that
in the test case, calendar reports correct output.
As I'm not comfortable with calendar(1) code, I don't know if the patch
breaks some other use. If someone feels confident to read the code and
import it, that would be nice.