X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=test%2Ftests%2Fbad-input%2Ftest-header;h=6b826a00d7fbfc7fd6b6a20ee70b0fcaeb97d3c8;hp=8a3251ef54388f2ab4f9447b895de44db9a0a698;hb=82325c1114254a76b8285bb710b2f651674331c7;hpb=9c61a657f72aa43b4a2f4e027ad84e7f65fb66cb diff --git a/test/tests/bad-input/test-header b/test/tests/bad-input/test-header index 8a3251e..6b826a0 100644 --- a/test/tests/bad-input/test-header +++ b/test/tests/bad-input/test-header @@ -1,25 +1,18 @@ #!/bin/sh ###################################################### # -# Test bogus headers (no blank line before body). +# Test bogus headers (no blank line before body, etc.) # ###################################################### -# 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 -} +. "$MH_TEST_COMMON" expected=$MH_TEST_DIR/$$.expected -actual=$MH_TEST_DIR/$$.actual # Write message with bogus header field (missing blank line, really). -msgfile=$(mhpath b) -msgnum=$(basename $msgfile) +msgfile="$(mhpath b)" +msgnum="$(basename $msgfile)" + cat > $msgfile < $expected < $actual 2>&1 -check +! # check show -cat > $expected <"$msgfile" +runandcheck "scan l" <"$msgfile" < $actual 2>&1 -check +runandcheck "scan l" </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" +cat >"$msgfile" <