[Midnightbsd-cvs] src [11453] trunk/usr.bin/pr: add tests

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jul 7 12:46:04 EDT 2018


Revision: 11453
          http://svnweb.midnightbsd.org/src/?rev=11453
Author:   laffer1
Date:     2018-07-07 12:46:03 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
add tests

Modified Paths:
--------------
    trunk/usr.bin/pr/Makefile
    trunk/usr.bin/pr/egetopt.c
    trunk/usr.bin/pr/extern.h
    trunk/usr.bin/pr/pr.1
    trunk/usr.bin/pr/pr.c

Added Paths:
-----------
    trunk/usr.bin/pr/tests/
    trunk/usr.bin/pr/tests/Makefile
    trunk/usr.bin/pr/tests/across.out
    trunk/usr.bin/pr/tests/basic2_test.sh
    trunk/usr.bin/pr/tests/merge.out
    trunk/usr.bin/pr/tests/other.in
    trunk/usr.bin/pr/tests/threecol.out

Property Changed:
----------------
    trunk/usr.bin/pr/pr.1

Modified: trunk/usr.bin/pr/Makefile
===================================================================
--- trunk/usr.bin/pr/Makefile	2018-07-07 16:44:26 UTC (rev 11452)
+++ trunk/usr.bin/pr/Makefile	2018-07-07 16:46:03 UTC (rev 11453)
@@ -1,7 +1,14 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/pr/Makefile 319257 2017-05-30 22:02:55Z asomers $
 
+.include <bsd.own.mk>
+
 PROG=	pr
 SRCS=	pr.c egetopt.c
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=        tests
+.endif
+
 .include <bsd.prog.mk>

Modified: trunk/usr.bin/pr/egetopt.c
===================================================================
--- trunk/usr.bin/pr/egetopt.c	2018-07-07 16:44:26 UTC (rev 11452)
+++ trunk/usr.bin/pr/egetopt.c	2018-07-07 16:46:03 UTC (rev 11453)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1991 Keith Muller.
  * Copyright (c) 1993
@@ -42,7 +43,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/pr/egetopt.c 293290 2016-01-07 00:40:51Z bdrewery $");
 
 #include <ctype.h>
 #include <stdio.h>
@@ -76,7 +77,7 @@
 {
 	static char *place = emsg;	/* option letter processing */
 	char *oli;			/* option letter list index */
-	static int delim;		/* which option delimeter */
+	static int delim;		/* which option delimiter */
 	char *p;
 	static char savec = '\0';
 

Modified: trunk/usr.bin/pr/extern.h
===================================================================
--- trunk/usr.bin/pr/extern.h	2018-07-07 16:44:26 UTC (rev 11452)
+++ trunk/usr.bin/pr/extern.h	2018-07-07 16:46:03 UTC (rev 11453)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1991 Keith Muller.
  * Copyright (c) 1993
@@ -35,10 +36,12 @@
  * SUCH DAMAGE.
  *
  *      @(#)extern.h	8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/pr/extern.h 227175 2011-11-06 08:16:24Z ed $
  */
 
+extern int eopterr;
 extern int eoptind;
+extern int eoptopt;
 extern char *eoptarg;
 
 void	 addnum(char *, int, int);

Modified: trunk/usr.bin/pr/pr.1
===================================================================
--- trunk/usr.bin/pr/pr.1	2018-07-07 16:44:26 UTC (rev 11452)
+++ trunk/usr.bin/pr/pr.1	2018-07-07 16:46:03 UTC (rev 11453)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1991 Keith Muller.
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -34,7 +35,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)pr.1	8.3 (Berkeley) 4/18/94
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/pr/pr.1 243238 2012-11-18 16:33:51Z eadler $
 .\"
 .Dd July 3, 2004
 .Dt PR 1


Property changes on: trunk/usr.bin/pr/pr.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/pr/pr.c
===================================================================
--- trunk/usr.bin/pr/pr.c	2018-07-07 16:44:26 UTC (rev 11452)
+++ trunk/usr.bin/pr/pr.c	2018-07-07 16:46:03 UTC (rev 11453)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 1991 Keith Muller.
  * Copyright (c) 1993
@@ -48,7 +49,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/pr/pr.c 319257 2017-05-30 22:02:55Z asomers $");
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -80,40 +81,40 @@
 /*
  * parameter variables
  */
-int	pgnm;			/* starting page number */
-int	clcnt;			/* number of columns */
-int	colwd;			/* column data width - multiple columns */
-int	across;			/* mult col flag; write across page */
-int	dspace;			/* double space flag */
-char	inchar;			/* expand input char */
-int	ingap;			/* expand input gap */
-int	pausefst;		/* Pause before first page */
-int	pauseall;		/* Pause before each page */
-int	formfeed;		/* use formfeed as trailer */
-char	*header;		/* header name instead of file name */
-char	ochar;			/* contract output char */
-int	ogap;			/* contract output gap */
-int	lines;			/* number of lines per page */
-int	merge;			/* merge multiple files in output */
-char	nmchar;			/* line numbering append char */
-int	nmwd;			/* width of line number field */
-int	offst;			/* number of page offset spaces */
-int	nodiag;			/* do not report file open errors */
-char	schar;			/* text column separation character */
-int	sflag;			/* -s option for multiple columns */
-int	nohead;			/* do not write head and trailer */
-int	pgwd;			/* page width with multiple col output */
-const char *timefrmt;		/* time conversion string */
+static int	pgnm;		/* starting page number */
+static int	clcnt;		/* number of columns */
+static int	colwd;		/* column data width - multiple columns */
+static int	across;		/* mult col flag; write across page */
+static int	dspace;		/* double space flag */
+static char	inchar;		/* expand input char */
+static int	ingap;		/* expand input gap */
+static int	pausefst;	/* Pause before first page */
+static int	pauseall;	/* Pause before each page */
+static int	formfeed;	/* use formfeed as trailer */
+static char	*header;	/* header name instead of file name */
+static char	ochar;		/* contract output char */
+static int	ogap;		/* contract output gap */
+static int	lines;		/* number of lines per page */
+static int	merge;		/* merge multiple files in output */
+static char	nmchar;		/* line numbering append char */
+static int	nmwd;		/* width of line number field */
+static int	offst;		/* number of page offset spaces */
+static int	nodiag;		/* do not report file open errors */
+static char	schar;		/* text column separation character */
+static int	sflag;		/* -s option for multiple columns */
+static int	nohead;		/* do not write head and trailer */
+static int	pgwd;		/* page width with multiple col output */
+static char	*timefrmt;	/* time conversion string */
 
 /*
  * misc globals
  */
-FILE	*err;			/* error message file pointer */
-int	addone;			/* page length is odd with double space */
-int	errcnt;			/* error count on file processing */
-char	digs[] = "0123456789";	/* page number translation map */
+static FILE	*err;		/* error message file pointer */
+static int	addone;		/* page length is odd with double space */
+static int	errcnt;		/* error count on file processing */
+static char	digs[] = "0123456789"; /* page number translation map */
 
-char	fnamedefault[] = FNAME;
+static char	fnamedefault[] = FNAME;
 
 int
 main(int argc, char *argv[])
@@ -135,6 +136,7 @@
 			ret_val = horzcol(argc, argv);
 		else
 			ret_val = vertcol(argc, argv);
+		free(timefrmt);
 	} else
 		usage();
 	flsh_errs();
@@ -207,6 +209,7 @@
 	 * allocate header buffer
 	 */
 	if ((hbuf = malloc((unsigned)(HDBUF + offst)*sizeof(char))) == NULL) {
+		free(obuf);
 		mfail();
 		return(1);
 	}
@@ -259,7 +262,7 @@
 					break;
 				if (!linecnt && !nohead &&
 					prhead(hbuf, fname, pagecnt))
-					return(1);
+					goto err;
 
 				/*
 				 * start of new line.
@@ -268,9 +271,9 @@
 					if (num)
 						addnum(nbuf, num, ++lncnt);
 					if (otln(obuf,cnt+off, &ips, &ops, mor))
-						return(1);
+						goto err;
 				} else if (otln(lbuf, cnt, &ips, &ops, mor))
-					return(1);
+					goto err;
 
 				/*
 				 * if line bigger than buffer, get more
@@ -293,7 +296,7 @@
 			 * fill to end of page
 			 */
 			if (linecnt && prtail(lines-linecnt-lrgln, lrgln))
-				return(1);
+				goto err;
 
 			/*
 			 * On EOF go to next file
@@ -306,8 +309,14 @@
 			(void)fclose(inf);
 	}
 	if (eoptind < argc)
-		return(1);
+		goto err;
+	free(hbuf);
+	free(obuf);
 	return(0);
+err:
+	free(hbuf);
+	free(obuf);
+	return(1);
 }
 
 /*
@@ -317,14 +326,14 @@
 vertcol(int argc, char *argv[])
 {
 	char *ptbf;
-	char **lstdat;
+	char **lstdat = NULL;
 	int i;
 	int j;
 	int cnt = -1;
 	int pln;
-	int *indy;
+	int *indy = NULL;
 	int cvc;
-	int *lindy;
+	int *lindy = NULL;
 	int lncnt;
 	int stp;
 	int pagecnt;
@@ -331,13 +340,13 @@
 	int col = colwd + 1;
 	int mxlen = pgwd + offst + 1;
 	int mclcnt = clcnt - 1;
-	struct vcol *vc;
+	struct vcol *vc = NULL;
 	int mvc;
 	int tvc;
 	int cw = nmwd + 1;
 	int fullcol;
-	char *buf;
-	char *hbuf;
+	char *buf = NULL;
+	char *hbuf = NULL;
 	char *ohbuf;
 	const char *fname;
 	FILE *inf;
@@ -345,6 +354,7 @@
 	int cps = 0;
 	int ops = 0;
 	int mor = 0;
+	int retval = 1;
 
 	/*
 	 * allocate page buffer
@@ -359,7 +369,7 @@
 	 */
 	if ((hbuf = malloc((unsigned)(HDBUF + offst)*sizeof(char))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 	ohbuf = hbuf + offst;
 	if (offst)
@@ -372,7 +382,7 @@
 	if ((vc =
 	    (struct vcol *)malloc((unsigned)mvc*sizeof(struct vcol))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 
 	/*
@@ -380,7 +390,7 @@
 	 */
 	if ((lstdat = (char **)malloc((unsigned)lines*sizeof(char *))) == NULL){
 		mfail();
-		return(1);
+		goto out;
 	}
 
 	/*
@@ -388,11 +398,11 @@
 	 */
 	if ((indy = (int *)malloc((unsigned)lines*sizeof(int))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 	if ((lindy = (int *)malloc((unsigned)lines*sizeof(int))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 
 	if (nmwd)
@@ -533,12 +543,13 @@
 				 * print header
 				 */
 				if (!nohead && prhead(hbuf, fname, pagecnt))
-					return(1);
+					goto out;
 				for (i = 0; i < pln; ++i) {
 					ips = 0;
 					ops = 0;
-					if (offst&& otln(buf,offst,&ips,&ops,1))
-						return(1);
+					if (offst &&
+					    otln(buf,offst,&ips,&ops,1))
+						goto out;
 					tvc = i;
 
 					for (j = 0; j < clcnt; ++j) {
@@ -563,7 +574,7 @@
 							cnt = fullcol;
 						if (otln(vc[tvc].pt, cnt, &ips,
 								&ops, 1))
-							return(1);
+							goto out;
 						tvc += pln;
 						if (tvc >= cvc)
 							break;
@@ -572,13 +583,13 @@
 					 * terminate line
 					 */
 					if (otln(buf, 0, &ips, &ops, 0))
-						return(1);
+						goto out;
 				}
 				/*
 				 * pad to end of page
 				 */
 				if (prtail((lines - pln), 0))
-					return(1);
+					goto out;
 				/*
 				 * done with output, go to next file
 				 */
@@ -597,7 +608,7 @@
 			 * print header
 			 */
 			if (pln && !nohead && prhead(hbuf, fname, pagecnt))
-				return(1);
+				goto out;
 
 			/*
 			 * output each line
@@ -607,7 +618,7 @@
 				if ((j = lstdat[i] - ptbf) <= offst)
 					break;
 				if (otln(ptbf, j, &ips, &ops, 0))
-					return(1);
+					goto out;
 			}
 
 			/*
@@ -614,7 +625,7 @@
 			 * pad to end of page
 			 */
 			if (pln && prtail((lines - pln), 0))
-				return(1);
+				goto out;
 
 			/*
 			 * if EOF go to next file
@@ -627,8 +638,16 @@
 			(void)fclose(inf);
 	}
 	if (eoptind < argc)
-		return(1);
-	return(0);
+		goto out;
+	retval = 0;
+out:
+	free(lindy);
+	free(indy);
+	free(lstdat);
+	free(vc);
+	free(hbuf);
+	free(buf);
+	return(retval);
 }
 
 /*
@@ -665,6 +684,7 @@
 	 * page header
 	 */
 	if ((hbuf = malloc((unsigned)(HDBUF + offst)*sizeof(char))) == NULL) {
+		free(buf);
 		mfail();
 		return(1);
 	}
@@ -744,12 +764,12 @@
 					break;
 				if (!i && !nohead &&
 					prhead(hbuf, fname, pagecnt))
-					return(1);
+					goto err;
 				/*
 				 * output line
 				 */
 				if (otln(buf, j, &ips, &ops, 0))
-					return(1);
+					goto err;
 			}
 
 			/*
@@ -756,7 +776,7 @@
 			 * pad to end of page
 			 */
 			if (i && prtail(lines-i, 0))
-				return(1);
+				goto err;
 
 			/*
 			 * if EOF go to next file
@@ -769,8 +789,14 @@
 			(void)fclose(inf);
 	}
 	if (eoptind < argc)
-		return(1);
+		goto err;
+	free(hbuf);
+	free(buf);
 	return(0);
+err:
+	free(hbuf);
+	free(buf);
+	return(1);
 }
 
 /*
@@ -786,14 +812,14 @@
 	int cnt;
 	char *lstdat;
 	int i;
-	FILE **fbuf;
+	FILE **fbuf = NULL;
 	int actf;
 	int lncnt;
 	int col;
 	int pagecnt;
 	int fproc;
-	char *buf;
-	char *hbuf;
+	char *buf = NULL;
+	char *hbuf = NULL;
 	char *ohbuf;
 	const char *fname;
 	int ips = 0;
@@ -800,6 +826,7 @@
 	int cps = 0;
 	int ops = 0;
 	int mor = 0;
+	int retval = 1;
 
 	/*
 	 * array of FILE *, one for each operand
@@ -806,7 +833,7 @@
 	 */
 	if ((fbuf = (FILE **)malloc((unsigned)clcnt*sizeof(FILE *))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 
 	/*
@@ -814,7 +841,7 @@
 	 */
 	if ((hbuf = malloc((unsigned)(HDBUF + offst)*sizeof(char))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 	ohbuf = hbuf + offst;
 
@@ -822,7 +849,7 @@
 	 * do not know how many columns yet. The number of operands provide an
 	 * upper bound on the number of columns. We use the number of files
 	 * we can open successfully to set the number of columns. The operation
-	 * of the merge operation (-m) in relation to unsuccesful file opens
+	 * of the merge operation (-m) in relation to unsuccessful file opens
 	 * is unspecified by posix.
 	 */
 	j = 0;
@@ -838,10 +865,10 @@
 	 * if no files, exit
 	 */
 	if (!j)
-		return(1);
+		goto out;
 
 	/*
-	 * calculate page boundries based on open file count
+	 * calculate page boundaries based on open file count
 	 */
 	clcnt = j;
 	if (nmwd) {
@@ -854,7 +881,7 @@
 	if (colwd < 1) {
 		(void)fprintf(err,
 		  "pr: page width too small for %d columns\n", clcnt);
-		return(1);
+		goto out;
 	}
 	actf = clcnt;
 	col = colwd + 1;
@@ -864,7 +891,7 @@
 	 */
 	if ((buf = malloc((unsigned)(pgwd+offst+1)*sizeof(char))) == NULL) {
 		mfail();
-		return(1);
+		goto out;
 	}
 	if (offst) {
 		(void)memset(buf, (int)' ', offst);
@@ -951,13 +978,13 @@
 				break;
 
 			if (!i && !nohead && prhead(hbuf, fname, pagecnt))
-				return(1);
+				goto out;
 
 			/*
 			 * output line
 			 */
 			if (otln(buf, j, &ips, &ops, 0))
-				return(1);
+				goto out;
 
 			/*
 			 * if no more active files, done
@@ -972,12 +999,17 @@
 		 * pad to end of page
 		 */
 		if (i && prtail(lines-i, 0))
-			return(1);
+			goto out;
 		++pagecnt;
 	}
 	if (eoptind < argc)
-		return(1);
-	return(0);
+		goto out;
+	retval = 0;
+out:
+	free(buf);
+	free(hbuf);
+	free(fbuf);
+	return(retval);
 }
 
 /*
@@ -987,7 +1019,7 @@
  *	inf:	file
  *	buf:	buffer
  *	lim:	buffer length
- *	cps:	column positon 1st char in buffer (large line support)
+ *	cps:	column position 1st char in buffer (large line support)
  *	trnc:	throw away data more than lim up to \n
  *	mor:	set if more data in line (not truncated)
  */
@@ -1344,6 +1376,7 @@
 					(void)fprintf(err,
 					     "pr: cannot get time of day, %s\n",
 					     strerror(errno));
+					fclose(inf);
 					return(NULL);
 				}
 				timeptr = localtime(&tv_sec);
@@ -1725,7 +1758,9 @@
 			break;
 		case 'w':
 			++wflag;
-			if (!isdigit((unsigned char)*eoptarg) || ((pgwd = atoi(eoptarg)) < 1)){
+			if ((eoptarg == NULL ) ||
+			    !isdigit((unsigned char)*eoptarg) ||
+			    ((pgwd = atoi(eoptarg)) < 1)){
 				(void)fputs(
 				   "pr: -w width must be 1 or more \n",err);
 				return(1);

Added: trunk/usr.bin/pr/tests/Makefile
===================================================================
--- trunk/usr.bin/pr/tests/Makefile	                        (rev 0)
+++ trunk/usr.bin/pr/tests/Makefile	2018-07-07 16:46:03 UTC (rev 11453)
@@ -0,0 +1,18 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/pr/tests/Makefile 320706 2017-07-06 05:20:30Z ngie $
+
+ATF_TESTS_SH+=    	basic2_test
+NETBSD_ATF_TESTS_SH=    basic
+
+FILES+=	across.out
+FILES+=	d_basic.in
+FILES+=	d_basic.out
+FILES+=	merge.out
+FILES+=	other.in
+FILES+=	threecol.out
+
+BINDIR=	${TESTSDIR}
+
+.include <netbsd-tests.test.mk>
+
+.include <bsd.test.mk>


Property changes on: trunk/usr.bin/pr/tests/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/pr/tests/across.out
===================================================================
--- trunk/usr.bin/pr/tests/across.out	                        (rev 0)
+++ trunk/usr.bin/pr/tests/across.out	2018-07-07 16:46:03 UTC (rev 11453)
@@ -0,0 +1,2 @@
+987 654 321			    ghi def abc
+foo bar baz


Property changes on: trunk/usr.bin/pr/tests/across.out
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/usr.bin/pr/tests/basic2_test.sh
===================================================================
--- trunk/usr.bin/pr/tests/basic2_test.sh	                        (rev 0)
+++ trunk/usr.bin/pr/tests/basic2_test.sh	2018-07-07 16:46:03 UTC (rev 11453)
@@ -0,0 +1,60 @@
+# Copyright (c) 2017 Alan Somers
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# $FreeBSD: stable/10/usr.bin/pr/tests/basic2_test.sh 316501 2017-04-04 20:03:57Z asomers $
+# $MidnightBSD$
+
+atf_test_case across
+across_head() {
+        atf_set "descr" "Format columns in round-robin order with pr -a"
+}
+across_body() {
+	atf_check -s exit:0 -o file:$(atf_get_srcdir)/across.out \
+		-x "pr -t -a -2 $(atf_get_srcdir)/other.in"
+}
+
+atf_test_case merge
+merge_head() {
+        atf_set "descr" "Merge two files with pr -m"
+}
+merge_body() {
+	atf_check -s ignore -o file:$(atf_get_srcdir)/merge.out \
+		pr -t -m $(atf_get_srcdir)/d_basic.in $(atf_get_srcdir)/other.in
+}
+
+atf_test_case threecol
+threecol_head() {
+        atf_set "descr" "Format a file with three columns"
+}
+threecol_body() {
+	atf_check -s ignore -o file:$(atf_get_srcdir)/threecol.out \
+		pr -t -3 $(atf_get_srcdir)/other.in
+}
+
+atf_init_test_cases()
+{
+        atf_add_test_case across
+        atf_add_test_case merge
+        atf_add_test_case threecol
+}


Property changes on: trunk/usr.bin/pr/tests/basic2_test.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/pr/tests/merge.out
===================================================================
--- trunk/usr.bin/pr/tests/merge.out	                        (rev 0)
+++ trunk/usr.bin/pr/tests/merge.out	2018-07-07 16:46:03 UTC (rev 11453)
@@ -0,0 +1,3 @@
+123 456 789			    987 654 321
+abc def ghi			    ghi def abc
+				    foo bar baz


Property changes on: trunk/usr.bin/pr/tests/merge.out
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: trunk/usr.bin/pr/tests/other.in
===================================================================
--- trunk/usr.bin/pr/tests/other.in	                        (rev 0)
+++ trunk/usr.bin/pr/tests/other.in	2018-07-07 16:46:03 UTC (rev 11453)
@@ -0,0 +1,3 @@
+987 654 321
+ghi def abc
+foo bar baz


Property changes on: trunk/usr.bin/pr/tests/other.in
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/usr.bin/pr/tests/threecol.out
===================================================================
--- trunk/usr.bin/pr/tests/threecol.out	                        (rev 0)
+++ trunk/usr.bin/pr/tests/threecol.out	2018-07-07 16:46:03 UTC (rev 11453)
@@ -0,0 +1 @@
+987 654 321		ghi def abc		foo bar baz


Property changes on: trunk/usr.bin/pr/tests/threecol.out
___________________________________________________________________
Added: mnbsd:nokeywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list