Add a regression test that (at least on some archs) catches the problem

fixed in  usr.bin/sort/fields.c rev. 1.18.
This commit is contained in:
martin 2004-03-14 23:01:33 +00:00
parent 5e6e0e1b39
commit 31644c5596
3 changed files with 28 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.6 2003/09/14 13:51:16 cjep Exp $
# $NetBSD: Makefile,v 1.7 2004/03/14 23:01:33 martin Exp $
SUBDIR+= bzip2 grep m4 make rtld sort
SUBDIR+= bzip2 grep m4 make rtld sort sort2
.include <bsd.subdir.mk>

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2004/03/14 23:01:33 martin Exp $
NOMAN= # defined
regress:
@${HOST_SH} ${.CURDIR}/sort2regress
.include <bsd.prog.mk>

View File

@ -0,0 +1,18 @@
#! /bin/sh
INFILE=/tmp/sort-input.$$
OUTFILE=/tmp/sort-output.$$
trap "rm -f $INFFILE $OUTFILE; echo FAILED; exit 0" 1 ILL TRAP ABRT BUS SEGV
printf "a b \na b\n" > $INFILE
sort +3 $INFILE > $OUTFILE || { echo "FAILED"; rm -f $INFILE $OUTFILE; exit 0; }
if cmp $INFILE $OUTFILE
then
echo PASSED
else
echo FAILED
fi
rm -f $INFILE $OUTFILE