1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#! /bin/sh
# diff.sh: Testing for the system diff utility.
# Import common functions & definitions.
. ../common/test-common
. ../common/real-thing
. ../common/config-data
if $binary_support
then
true
else
echo "Skipping these tests -- no binary file support."
exit 0
fi
echo_nonl t1...
remove test/d1 test/d2 test
mkdir test
echo hello > test/d1
echo hello > test/d2
${DIFF} test/d1 test/d2 >got.stdout 2>got.stderr
rv=$?
if test $rv -ne 0
then
fail "${DIFF} returns nozero for identical files"
fi
echo passed
echo_nonl t2...
remove test/d2
echo world > test/d2
${DIFF} test/d1 test/d2 >got.stdout 2>got.stderr
rv=$?
if test $rv -eq 0
then
fail "${DIFF} returns zero for nonidentical files"
fi
remove test/d1 test/d2 test
echo passed
success
|