3 # a simple component of unit testing which verifies that the input matches
6 # the single parameter to the script is a file that contains the correct answer.
8 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
10 answer_file="$1"; shift
12 if [ -z "$answer_file" -o ! -f "$answer_file" ]; then
13 echo This script needs a valid file parameter that points at the correct
14 echo values for the data stream.
18 input_save_file="$(mktemp "$TMP/zz_verify_input.XXXXXX")"
21 echo $line >>"$input_save_file"
24 diff -q "$input_save_file" "$answer_file"
27 echo "The provided text differs from the correct answer!"
28 echo -e "\nAnswer file has:\n=============="
30 echo -e "==============\nBut the data we saw has:\n=============="
31 cat "$input_save_file"
32 echo -e "=============="
34 false # set bad exit value.