A simple test for join(1) based on tjr's test case for -o 0.

Partially based on:	PR standards/36072
This commit is contained in:
Juli Mallett 2002-04-20 19:33:23 +00:00
parent 72cd6fa0c0
commit 3df2cd2cc9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95148
6 changed files with 35 additions and 1 deletions

View File

@ -1,5 +1,5 @@
# $FreeBSD$
SUBDIR= file2c uudecode uuencode xargs
SUBDIR= file2c join uudecode uuencode xargs
.include <bsd.subdir.mk>

View File

@ -0,0 +1,4 @@
# $FreeBSD$
all:
@sh ${.CURDIR}/regress.sh ${.CURDIR}

View File

@ -0,0 +1,4 @@
!Name,Data1
Foo,1
Bar,2
Baz,3

View File

@ -0,0 +1,4 @@
!Name,Data2
Foo,Bar
Baz,2
Foobar,1

View File

@ -0,0 +1,5 @@
!Name,Data1,Data2
Foo,1,Bar
Bar,2,(unknown)
Baz,3,2
Foobar,(unknown),1

View File

@ -0,0 +1,17 @@
# $FreeBSD$
# Go into the regression test directory, handed to us by make(1)
TESTDIR=$1
if [ -z "$TESTDIR" ]; then
TESTDIR=.
fi
cd $TESTDIR
join -t , -a1 -a2 -e '(unknown)' -o 0,1.2,2.2 regress.1.in regress.2.in | \
diff -u regress.out -
if [ $? -eq 0 ]; then
echo "Test detected no regression, output matches."
else
echo "Test failed: regression detected. See above."
exit 1
fi