X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/28b8c0de6bf580a9a07bbc15c407eecfb561667d..a616a7953d87c3c51afcc8e693c48c37ec000edf:/test/bad-input/test-header diff --git a/test/bad-input/test-header b/test/bad-input/test-header index 9e66296d..0e210dba 100755 --- a/test/bad-input/test-header +++ b/test/bad-input/test-header @@ -1,7 +1,7 @@ #!/bin/sh ###################################################### # -# Test bogus headers (no blank line before body). +# Test bogus headers (no blank line before body, etc.) # ###################################################### @@ -14,13 +14,14 @@ fi setup_test -expected=$MH_TEST_DIR/$$.expected -actual=$MH_TEST_DIR/$$.actual +expected="$MH_TEST_DIR/$$.expected" +expected_err="$MH_TEST_DIR/$$.expected_err" +actual="$MH_TEST_DIR/$$.actual" +actual_err="$MH_TEST_DIR/$$.actual_err" # Write message with bogus header field (missing blank line, really). -msgfile=`mhpath new` -msgnum=`basename $msgfile` -cat > $msgfile <"$msgfile" < $expected <"$expected" < $actual 2>&1 -check $expected $actual +scan -width 80 last > "$actual" 2>&1 +check "$expected" "$actual" # check show (mhl) -cat > $expected <"$expected" < $actual 2>&1 -check $expected $actual +show last > "$actual" 2>&1 +check "$expected" "$actual" # check mhshow -cat > $expected <"$expected" < $actual 2>&1 -check $expected $actual +mhshow -nopause last > "$actual" 2>&1 +check "$expected" "$actual" + +# check m_getfld() handling of empty header field +msgfile="$MH_TEST_DIR/Mail/inbox/12" +printf 'Date: Sat, 12 Jan 2013 09:07:01 -0600\nReceived:' >"$msgfile" +cat >"$expected" <"$expected_err" <"$actual" 2>"$actual_err" +check "$expected" "$actual" +check "$expected_err" "$actual_err" + +# check m_getfld() handling of excessively long header field name +msgfile="$MH_TEST_DIR/Mail/inbox/13" +cat >"$msgfile" <"$expected" <"$expected_err" <"$actual" 2>"$actual_err" +check "$expected" "$actual" +check "$expected_err" "$actual_err" + +# check m_getfld() handling of long header field name without a colon +msgfile="$MH_TEST_DIR/Mail/inbox/14" +cat >"$msgfile" <"$expected" <"$expected_err" <"$actual" 2>"$actual_err" +check "$expected" "$actual" +check "$expected_err" "$actual_err" + exit $failed