]> diplodocus.org Git - nmh/blobdiff - test/bad-input/test-header
Reverted commit 9a4b4a3d3b27fe4a7ff6d0b8724ce1c06b5917eb.
[nmh] / test / bad-input / test-header
index 1716ff1f1098ad6e3461e0a3c616986ed1bf520e..ef7b3992cdf456677e1587807195c3bae760efbd 100755 (executable)
@@ -34,13 +34,15 @@ I am a stupid spammer.
 EOF
 
 # check scan
+start_test scan
 cat >"$expected" <<EOF
   11  12/18 foo@example.edu    test<<This is a multi-part message in MIME format
 EOF
 run_prog scan -width 80 last > "$actual" 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : scan with bogus header field
 
 # check show (mhl)
+start_test show
 cat >"$expected" <<EOF
 (Message inbox:11)
 
@@ -55,10 +57,12 @@ This is a multi-part message in MIME format.
 I am a stupid spammer.
 EOF
 run_prog show last > "$actual" 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : "show (mhl) with bogus header field"
 
 # check mhshow
+start_test mhshow
 cat >"$expected" <<EOF
+[ Message inbox:11 ]
 Date:    Sun, 18 Dec 2005 00:52:39 +0100
 To:      bar@example.edu
 From:    foo@example.edu
@@ -72,9 +76,10 @@ This is a multi-part message in MIME format.
 I am a stupid spammer.
 EOF
 run_prog mhshow last > "$actual" 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : mhshow with bogus header field
 
 # check m_getfld() handling of empty header field
+start_test '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" <<EOF
@@ -86,10 +91,11 @@ scan: eof encountered in field "Received"
 EOF
 
 run_prog scan -width 13 last >"$actual" 2>"$actual_err"
-check "$expected" "$actual"
-check "$expected_err" "$actual_err"
+check "$expected" "$actual" : m_getfld, empty header output
+check "$expected_err" "$actual_err" : m_getfld, empty header error
 
 # check m_getfld() handling of excessively long header field name
+start_test 'm_getfld() handling of excessively long header field name'
 msgfile="$MH_TEST_DIR/Mail/inbox/13"
 cat >"$msgfile" <<EOF
 Date: Tue, 15 Jan 2013 21:13:12 -0600
@@ -100,7 +106,7 @@ cat >"$expected" <<EOF
 EOF
 
 run_prog scan -width 13 last >"$actual" 2>"$actual_err"
-check "$expected" "$actual"
+check "$expected" "$actual" : m_getfld with excessively long header field name
 # 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() {
@@ -117,6 +123,7 @@ 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
+start_test 'm_getfld() handling of long header field name without a colon'
 msgfile="$MH_TEST_DIR/Mail/inbox/14"
 cat >"$msgfile" <<EOF
 Date: Thu, 17 Jan 2013 19:33:46 -0600
@@ -135,8 +142,9 @@ scan: eol encountered in field "If a header field name has at least 512 characte
 EOF
 
 run_prog scan -width 13 last >"$actual" 2>"$actual_err"
-check "$expected" "$actual"
-check "$expected_err" "$actual_err"
+check "$expected" "$actual" : m_getfld with long header, no colon output
+check "$expected_err" "$actual_err" : m_getfld with long header, no colon error
 
 
+finish_test
 exit $failed