X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=test%2Ftests%2Fbad-input%2Ftest-header;h=6b826a00d7fbfc7fd6b6a20ee70b0fcaeb97d3c8;hp=4832106ca14db7d6b50ba7103ac07e22eeddc593;hb=82325c1114254a76b8285bb710b2f651674331c7;hpb=8b4410a1f3cb75e3d92b61176397655d509f81ee diff --git a/test/tests/bad-input/test-header b/test/tests/bad-input/test-header index 4832106..6b826a0 100644 --- a/test/tests/bad-input/test-header +++ b/test/tests/bad-input/test-header @@ -1,20 +1,18 @@ #!/bin/sh +###################################################### +# +# 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 new) -msgnum=$(basename $msgfile) +msgfile="$(mhpath b)" +msgnum="$(basename $msgfile)" + cat > $msgfile < $expected < $actual 2>&1 -check +runandcheck "scan $msgnum" < $expected <"$msgfile" +runandcheck "scan l" <"$msgfile" < $actual 2>&1 -check +runandcheck "scan l" < $expected </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" < $actual 2>&1 -check + +runandcheck "scan l" <