#!/bin/sh # Check wdiff against some simple test cases. # Copyright (C) 1992 Free Software Foundation, Inc. wdiff=./wdiff input1=/tmp/wd.$$a input2=/tmp/wd.$$b expect=/tmp/wd.$$c output=/tmp/wd.$$d fail="echo; echo Check FAILED; rm -f $input1 $input2 $expect $output; exit 1" trap "$fail" 1 2 3 14 15 cat > $input1 < $input2 < $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -1" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -2" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -3" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -12" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -13" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -23" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -123" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -123s" cat > $expect < $output diff $expect $output || eval "$fail" echo "Checking wdiff -wxyz" cat > $expect <> The quick brown fox jumps over the lazy dog. The (hurried orange) <> fox jumps over the lazy dog. A (slow) <> green (panda) <> walks around a sleeping cat. The middling red fox jumps over the lazy dog. END_OF_FILE $wdiff -w\( -x\) -y\<\< -z\>\> $input1 $input2 > $output diff $expect $output || eval "$fail" rm -f $input1 $input2 $expect $output echo echo All checks successful