projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dropped debugging
[feisty_meow.git]
/
scripts
/
unit_test
/
verify_correct_input.sh
diff --git
a/scripts/unit_test/verify_correct_input.sh
b/scripts/unit_test/verify_correct_input.sh
index 28063eef76d9f43e3510a9aa88658d733fbcbc34..1cdef40cbd3c517e812b2225f18637a16a2fcdbf 100644
(file)
--- a/
scripts/unit_test/verify_correct_input.sh
+++ b/
scripts/unit_test/verify_correct_input.sh
@@
-1,6
+1,7
@@
#/bin/bash
#/bin/bash
-# a simple component of unit testing which verifies that the input matches the output.
+# a simple component of unit testing which verifies that the input matches
+# the expected input.
# the single parameter to the script is a file that contains the correct answer.
# the single parameter to the script is a file that contains the correct answer.
@@
-9,8
+10,8
@@
source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
answer_file="$1"; shift
if [ -z "$answer_file" -o ! -f "$answer_file" ]; then
answer_file="$1"; shift
if [ -z "$answer_file" -o ! -f "$answer_file" ]; then
- echo This script needs a
parameter which is a valid file filled with the
- echo
correct version of the input
.
+ echo This script needs a
valid file parameter that points at the correct
+ echo
values for the data stream
.
exit 1
fi
exit 1
fi
@@
-23,15
+24,17
@@
done
diff -q "$input_save_file" "$answer_file"
if [ $? -ne 0 ]; then
sep 76
diff -q "$input_save_file" "$answer_file"
if [ $? -ne 0 ]; then
sep 76
- echo "The provided
inpu
t differs from the correct answer!"
+ echo "The provided
tex
t differs from the correct answer!"
echo -e "\nAnswer file has:\n=============="
cat "$answer_file"
echo -e "\nAnswer file has:\n=============="
cat "$answer_file"
- echo -e "==============\nBut the
input data
has:\n=============="
+ echo -e "==============\nBut the
data we saw
has:\n=============="
cat "$input_save_file"
echo -e "=============="
sep 76
false # set bad exit value.
fi
cat "$input_save_file"
echo -e "=============="
sep 76
false # set bad exit value.
fi
+rm "$input_save_file"
+
exit $?
exit $?