From: David Levine Date: Sat, 19 Jan 2013 01:19:00 +0000 (-0600) Subject: Fixed test-header to work on Cygwin, which has a BUFSIZ of X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/8f9e13ed0ad6f7cad92f3f1fdc66d396d3a389a3?ds=inline;hp=--cc Fixed test-header to work on Cygwin, which has a BUFSIZ of only 1024. That caused an error message to be truncated. --- 8f9e13ed0ad6f7cad92f3f1fdc66d396d3a389a3 diff --git a/test/bad-input/test-header b/test/bad-input/test-header index 0e210dba..e993cce8 100755 --- a/test/bad-input/test-header +++ b/test/bad-input/test-header @@ -5,6 +5,8 @@ # ###################################################### +set -e + if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR @@ -96,14 +98,23 @@ EOF cat >"$expected" <"$expected_err" <"$actual" 2>"$actual_err" check "$expected" "$actual" -check "$expected_err" "$actual_err" +# Cygwin has a BUFSIZ of 1024 so the error message gets truncated. +# Deal with that by grepping to verify that scan showed the proper error. +verify_string_in_file() { + if grep "$1" "$2" >/dev/null; then + : + else + echo "$0: did not receive expected error message \"$1\"" + failed=`expr ${failed:-0} + 1` + fi +} +verify_string_in_file 'scan: field name "ThisHeaderFieldNameIsWa' "$actual_err" +verify_string_in_file 'exceeds 997' "$actual_err" +verify_string_in_file '??Format error (message 13) in component 2' "$actual_err" +rm -f "$actual_err" # check m_getfld() handling of long header field name without a colon msgfile="$MH_TEST_DIR/Mail/inbox/14"