]> diplodocus.org Git - nmh/blobdiff - test/inc/test-inc-scanout
Moved test of empty header field from
[nmh] / test / inc / test-inc-scanout
index 75be7dc2f0cf3dc148cb04fc2acafbf8f9e86683..adc7867acf69a2058573b8647e37c14d2a2199ad 100755 (executable)
@@ -15,6 +15,10 @@ fi
 
 setup_test
 
+thisdir="$srcdir/test/inc"
+expected="$MH_TEST_DIR/$$.expected"
+actual="$MH_TEST_DIR/$$.actual"
+
 cat > "${MH_TEST_DIR}/test.mbox" <<EOF
 From nobody@nowhereville Jan 1 1970
 Received: I am the very model of a modern Major-General,
@@ -189,7 +193,26 @@ run_test "inc -file ${MH_TEST_DIR}/test.mbox -width 120 -truncate" \
 
   11+ 03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cos"
 
-check "${MH_TEST_DIR}/test.mbox.2" "$(mhpath +inbox 11)"
+check `mhpath +inbox 11` "${MH_TEST_DIR}/test.mbox.2" "keep first"
 rm -f "${MH_TEST_DIR}/test.mbox" "${MH_TEST_DIR}/test.mbox.2"
 
+run_test "scan -width 120 +inbox 11" \
+       "  11+ 03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cos"
+
+# check header field name with ':' character than lands on m_getfld() buffer
+run_test "scan -width 60 -file $thisdir/lots_of_headers.txt" \
+         '   1  01/10 No Such User       all that and nothing to say?'
+
+# 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.
+cat >`mhpath new` <<EOF
+Date : Sun, 18 Dec 2005 00:52:39 +0100
+From   : foo@example.edu
+To: bar@example.edu
+Subject: test
+EOF
+run_test 'scan last' '  12  12/18 foo@example.edu    test'
+
+
 exit ${failed:-0}