1# $OpenBSD: Makefile,v 1.1 2018/07/11 20:24:35 schwarze Exp $
2
3LAM		= LC_CTYPE=en_US.UTF-8 lam
4REGRESS_TARGETS	= noarg fonly Fback pminus stdio
5CLEANFILES	= ${REGRESS_TARGETS:C/^/out_/:C/$/.txt/}
6
7noarg:
8	${LAM} ${.CURDIR}/in1.txt ${.CURDIR}/in2.txt ${.CURDIR}/in3.txt > \
9		out_noarg.txt
10	diff -u ${.CURDIR}/expect_noarg.txt out_noarg.txt
11
12# also test padding (in1), truncation (in2), and back to default
13fonly:
14	${LAM} -f 9 ${.CURDIR}/in1.txt -f .9 ${.CURDIR}/in2.txt \
15		${.CURDIR}/in3.txt > out_fonly.txt
16	diff -u ${.CURDIR}/expect_fonly.txt out_fonly.txt
17
18# also test 0 padding, and padding combined with truncation 
19Fback:
20	${LAM} -F 010 ${.CURDIR}/in1.txt ${.CURDIR}/in2.txt \
21		-f 7.6 ${.CURDIR}/in3.txt > out_Fback.txt
22	diff -u ${.CURDIR}/expect_Fback.txt out_Fback.txt
23
24# also test separator, left alignment, and column padding
25pminus:
26	${LAM} -S '|' -F 9.9 ${.CURDIR}/in1.txt -P -9.9 ${.CURDIR}/in2.txt \
27		${.CURDIR}/in3.txt > out_pminus.txt
28	diff -u ${.CURDIR}/expect_pminus.txt out_pminus.txt
29
30# also test line ending and separators
31stdio:
32	printf "11:12;21:22;" | ${LAM} -t ':' - -S= -t ';' - -s '%' > \
33		out_stdio.txt
34	diff -u ${.CURDIR}/expect_stdio.txt out_stdio.txt
35
36.include <bsd.regress.mk>
37