X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6106441685a38400d9aa94ccb7218218102f941c..4548a3ecc4248a1d4bd4fdd45d9a2bb1e61d1e70:/test/bad-input/test-header diff --git a/test/bad-input/test-header b/test/bad-input/test-header index 35d680a6..9e66296d 100755 --- a/test/bad-input/test-header +++ b/test/bad-input/test-header @@ -5,29 +5,21 @@ # ###################################################### -if [ -z "${MH_TEST_COMMON}" ]; then - echo "MH_TEST_COMMON not set; try running via 'make check'" +if test -z "${MH_OBJ_DIR}"; then + srcdir=`dirname "$0"`/../.. + MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi -. ${MH_TEST_COMMON} +. "$MH_OBJ_DIR/test/common.sh" setup_test -# TODO: Move to a common file tests can source; need more framework... -failed=0 -check() { - diff -u $expected $actual - if [ $? -ne 0 ]; then - failed=$((failed + 1)) - fi -} - expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with bogus header field (missing blank line, really). -msgfile=$(mhpath new) -msgnum=$(basename $msgfile) +msgfile=`mhpath new` +msgnum=`basename $msgfile` cat > $msgfile < $expected < $actual 2>&1 -check +scan -width 80 $msgnum > $actual 2>&1 +check $expected $actual # check show (mhl) cat > $expected < $actual 2>&1 -check +check $expected $actual # check mhshow cat > $expected < $actual 2>&1 -check +check $expected $actual exit $failed