]> git.marmaro.de Git - mmh/blobdiff - test/common.sh.in
Moved check() function from individual tests to common.sh.
[mmh] / test / common.sh.in
index 7596a4850d7b40ce5563e4704e234f83a1dc4360..0d7e858d842e49030f9941846dcb673f351e7be1 100644 (file)
@@ -76,6 +76,14 @@ progress_done ()
   printf "100%%\n"
 }
 
+#### check() requires two arguments, each the name of a file to be
+#### diff'ed.
+#### If different, global variable "failed" is incremented.
+check() {
+    #### POSIX diff should support -c.
+    diff -c "$1" "$2"  ||  failed=`expr ${failed:-0} + 1`
+}
+
 setup_test ()
 {
   export MH=${MH_TEST_DIR}/Mail/.mh_profile