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:
parent
ca4e8950a4
commit
7c76f6f023
@ -1,5 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= file2c uudecode uuencode xargs
|
||||
SUBDIR= file2c join uudecode uuencode xargs
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
4
tools/regression/usr.bin/join/Makefile
Normal file
4
tools/regression/usr.bin/join/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@sh ${.CURDIR}/regress.sh ${.CURDIR}
|
4
tools/regression/usr.bin/join/regress.1.in
Normal file
4
tools/regression/usr.bin/join/regress.1.in
Normal file
@ -0,0 +1,4 @@
|
||||
!Name,Data1
|
||||
Foo,1
|
||||
Bar,2
|
||||
Baz,3
|
4
tools/regression/usr.bin/join/regress.2.in
Normal file
4
tools/regression/usr.bin/join/regress.2.in
Normal file
@ -0,0 +1,4 @@
|
||||
!Name,Data2
|
||||
Foo,Bar
|
||||
Baz,2
|
||||
Foobar,1
|
5
tools/regression/usr.bin/join/regress.out
Normal file
5
tools/regression/usr.bin/join/regress.out
Normal file
@ -0,0 +1,5 @@
|
||||
!Name,Data1,Data2
|
||||
Foo,1,Bar
|
||||
Bar,2,(unknown)
|
||||
Baz,3,2
|
||||
Foobar,(unknown),1
|
17
tools/regression/usr.bin/join/regress.sh
Normal file
17
tools/regression/usr.bin/join/regress.sh
Normal 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
|
Loading…
x
Reference in New Issue
Block a user