#### 'keep first'.
#### If different, global variable "failed" is incremented.
#### If there's an optional 'ignore space' argument, diff -b will
-#### be used instead of cmp to compare the files.
+#### be used instead of cmp to compare the files.
check() {
first=$1; shift
second=$1; shift
case $1 in
'keep first') keepfirst=1 ;;
'ignore space') ignorespace=1 ;;
- *) echo "$0: invalid command $1" ;;
+ *) echo "$0: invalid check() argument \"$1\" in test suite" >&2 ;;
esac
shift
done
echo
echo "$0: test failed, outputs are in $first and $second."
failed=`expr ${failed:-0} + 1`
+ #### Set return status of the function.
+ [ $failed -eq 0 ]
fi
}