test/inc/test-inc-scanout to test/bad-input/test-header.
man/unseen.man man/whatnow.man man/whom.man \
test/README test/fakesendmail $(TESTS) test/inc/deb359167.mbox \
test/inc/fromline.txt test/inc/msgheader.txt test/inc/filler.txt \
- test/inc/lots_of_headers.txt test/inc/malformed_message.txt \
- test/inc/md5sums test/mhmail/attachment.txt \
+ test/inc/lots_of_headers.txt test/inc/md5sums \
+ test/bad-input/malformed_message.txt \
+ test/mhmail/attachment.txt \
test/post/test-post-common.sh uip/mhmail \
SPECS/nmh.spec SPECS/build-nmh-cygwin
#!/bin/sh
######################################################
#
-# Test bogus headers (no blank line before body).
+# Test bogus headers (no blank line before body, etc.)
#
######################################################
setup_test
-expected=$MH_TEST_DIR/$$.expected
-actual=$MH_TEST_DIR/$$.actual
+thisdir="$srcdir/test/bad-input"
+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 <<EOF
+cat > "$msgfile" <<EOF
Date: Sun, 18 Dec 2005 00:52:39 +0100
From: foo@example.edu
To: bar@example.edu
EOF
# check scan
-cat > $expected <<EOF
+cat > "$expected" <<EOF
11 12/18 foo@example.edu test<<This is a multi-part message in MIME forma
EOF
-scan -width 80 $msgnum > $actual 2>&1
-check $expected $actual
+scan -width 80 $msgnum > "$actual" 2>&1
+check "$expected" "$actual"
# check show (mhl)
-cat > $expected <<EOF
+cat > "$expected" <<EOF
(Message inbox:11)
Date: Sun, 18 Dec 2005 00:52:39 +0100
I am a stupid spammer.
EOF
-show $msgnum > $actual 2>&1
-check $expected $actual
+show $msgnum > "$actual" 2>&1
+check "$expected" "$actual"
# check mhshow
-cat > $expected <<EOF
+cat > "$expected" <<EOF
Date: Sun, 18 Dec 2005 00:52:39 +0100
To: bar@example.edu
From: foo@example.edu
I am a stupid spammer.
EOF
-mhshow -nopause $msgnum > $actual 2>&1
-check $expected $actual
+mhshow -nopause $msgnum > "$actual" 2>&1
+check "$expected" "$actual"
+
+# check m_getfld() handling of empty header field
+cat >"$expected" <<EOF
+ 1 01/12
+EOF
+cat >"$expected_err" <<EOF
+scan: eof encountered in field "Received"
+??Format error (message -1) in component 2
+EOF
+
+scan -width 13 -file "$thisdir"/malformed_message.txt >"$actual" 2>"$actual_err"
+
+check "$expected" "$actual"
+check "$expected_err" "$actual_err"
+
exit $failed
4112b1460e11bd94d30944dd464a6662 filler.txt
023aad60eab43f06cf525869a833beb4 fromline.txt
0c4fd7cd528519e83011015bfae3e458 lots_of_headers.txt
-c5bf54a59425ee730080e71b64162840 malformed_message.txt
4fda7f16b29d757413cb928d6ffc5aa5 msgheader.txt
thisdir="$srcdir/test/inc"
expected="$MH_TEST_DIR/$$.expected"
-expected_err="$MH_TEST_DIR/$$.expected_err"
actual="$MH_TEST_DIR/$$.actual"
-actual_err="$MH_TEST_DIR/$$.actual_err"
cat > "${MH_TEST_DIR}/test.mbox" <<EOF
From nobody@nowhereville Jan 1 1970
run_test "scan -width 60 -file $thisdir/lots_of_headers.txt" \
' 1 01/10 No Such User all that and nothing to say?'
-cat >"$expected" <<EOF
- 1 01/12
-EOF
-cat >"$expected_err" <<EOF
-scan: eof encountered in field "Received"
-??Format error (message -1) in component 2
-EOF
-
# check m_getfld() handling of fields with trailing whitespace
# Even though header field names aren't supposed to have spaces (RFC
# 28220, m_getfld () trims trailing whitespace from them.
run_test 'scan last' ' 12 12/18 foo@example.edu test'
-# check m_getfld() handling of empty header field
-scan -width 13 -file "$thisdir"/malformed_message.txt >"$actual" 2>"$actual_err"
-
-check "$expected" "$actual"
-check "$expected_err" "$actual_err"
-
-
exit ${failed:-0}