]> diplodocus.org Git - nmh/blobdiff - test/inc/test-inc-scanout
Removed obsolete comment about use of getcpy().
[nmh] / test / inc / test-inc-scanout
index ffe2c46da8f26e81e29980d12140a4b523ba5727..4dd5a2657a5c27c05d0efebc25d03ea800335853 100755 (executable)
@@ -191,19 +191,19 @@ EOF
 run_test "inc -file ${MH_TEST_DIR}/test.mbox -width 120 -truncate" \
        "Incorporating new mail into inbox...
 
-  11+ 03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cos"
+  11+ 03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cost"
 
 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"
+       "  11+ 03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cost"
 
 # check header field name with ':' character than lands on m_getfld() buffer
 cat >"$MH_TEST_DIR/mess" <<EOF
-Comments: The important characteristic of this message is that the 4097'th
+Comments: The important characteristic of this message is that the 8193'rd
 Comments: byte is the ':' at the end of header field name.  That tests some
-Comments: logic in m_getfld (), assuming its MSG_INPUT_SIZE is 4096.
+Comments: logic in m_getfld (), assuming its MSG_INPUT_SIZE is 8192.
 Comments: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 Comments: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 Comments: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
@@ -252,8 +252,60 @@ Comments: ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
 Comments: tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
 Comments: uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
 Comments: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
-Comments: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
-Comments: This is it, the line with the 4097'th character of ':'.
+Comments: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+Comments: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Comments: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
+Comments: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+Comments: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+Comments: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
+Comments: CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
+Comments: DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
+Comments: EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
+Comments: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF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TTTTTTTTTTTTTTTTTTTTTTTTTTTTT
+Comments: UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
+Comments: VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
+Comments: WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
+Comments: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Comments: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
+Comments: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
+Comments: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+Comments: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+Comments: cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
+Comments: dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
+Comments: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+Comments: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+Comments: gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
+Comments: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+Comments: iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+Comments: jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+Comments: kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+Comments: llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
+Comments: mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
+Comments: nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
+Comments: oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+Comments: pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
+Comments: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
+Comments: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
+Comments: ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
+Comments: tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
+Comments: uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
+Comments: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+Comments: wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+Comments: This is it, the line with the 8193'rd character of ':'.
 Comments: From somewhere
 From: No Such User <nosuch@example.com>
 To: Some Other User <someother@example.com>
@@ -297,6 +349,42 @@ run_test 'scan -width 80 -file '"$MH_TEST_DIR"'/mess' \
          '   1  01/16 No Such User       FLDPLUS test'
 rm -f "$MH_TEST_DIR/mess"
 
+# check inc of message with header field body with more than 511 characters
+cat >"$expected" <<EOF
+Comments: The important characteristic of this message is that this header
+          field body is more than 511 bytes long.  That tests the logic in
+          m_getfld () for transitioning to the FLDPLUS state.  This is the
+          only use for the FLDPLUS state, handling header field bodies that
+          are longer than the buffer used to retrieve them.  The trailing
+          newline after the last character is the 512th character.  The 511th
+          character, counting all spaces, even the leading one, is*
+          And, it continues onto this line.
+From: No Such User <nosuch@example.com>
+To: Some Other User <someother@example.com>
+Subject: FLDPLUS test
+Date: Wed, 16 Jan 2013 20:33:58 -0600
+EOF
+
+cat >"$MH_TEST_DIR/mess" <<EOF
+From nosuch@example.com  Wed 16 Jan 2013 20:33:58 -0600
+Comments: The important characteristic of this message is that this header
+          field body is more than 511 bytes long.  That tests the logic in
+          m_getfld () for transitioning to the FLDPLUS state.  This is the
+          only use for the FLDPLUS state, handling header field bodies that
+          are longer than the buffer used to retrieve them.  The trailing
+          newline after the last character is the 512th character.  The 511th
+          character, counting all spaces, even the leading one, is*
+          And, it continues onto this line.
+From: No Such User <nosuch@example.com>
+To: Some Other User <someother@example.com>
+Subject: FLDPLUS test
+Date: Wed, 16 Jan 2013 20:33:58 -0600
+
+EOF
+run_prog inc -file "$MH_TEST_DIR/mess" >/dev/null
+check "$expected" `mhpath last`  ||  rmm last
+rm -f "$MH_TEST_DIR/mess"
+
 # check scan and inc of mbox with multiple messages
 echo y | packf -file "$MH_TEST_DIR/msgbox"
 run_test "scan -width 80 -file $MH_TEST_DIR/msgbox" \
@@ -310,7 +398,7 @@ run_test "scan -width 80 -file $MH_TEST_DIR/msgbox" \
    8  09/29 Test8              Testing message 8<<This is message number 8 >>
    9  09/29 Test9              Testing message 9<<This is message number 9 >>
   10  09/29 Test10             Testing message 10<<This is message number 10 >>
-  11  03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. An
+  11  03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And
   12  12/18 foo@example.edu    test'
 run_test "inc -width 80 -file $MH_TEST_DIR/msgbox -truncate" \
 'Incorporating new mail into inbox...
@@ -325,9 +413,85 @@ run_test "inc -width 80 -file $MH_TEST_DIR/msgbox -truncate" \
   20  09/29 Test8              Testing message 8<<This is message number 8 >>
   21  09/29 Test9              Testing message 9<<This is message number 9 >>
   22  09/29 Test10             Testing message 10<<This is message number 10 >>
-  23  03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. An
+  23  03/01 Mr Nobody          Who is on first?<<Abbott: Every dollar of it. And
   24  12/18 foo@example.edu    test'
 rm -f  "$MH_TEST_DIR/msgbox"
 
+# check mbox with two blank lines between header and body
+cat >>"$MH_TEST_DIR/msgbox" <<EOF
+From 
+Date: Mon, 15 Apr 2013 21:02:12 -0500
+From: me@example.com
+
+
+test
+EOF
+
+run_test "inc -width 60 -file $MH_TEST_DIR/msgbox -truncate" \
+'Incorporating new mail into inbox...
+
+  25+ 04/15 me@example.com     <<test >>'
+rm -f  "$MH_TEST_DIR/msgbox"
+
+# check inc (m_getfld, actually) of very, very, very short message
+cat >>"$MH_TEST_DIR/msgbox" <<EOF
+From 
+Date: Tue, 6 Sep 2016 08:52:32 -0400
+From: me@example.com
+
+a
+EOF
+
+run_test "inc -width 50 -file $MH_TEST_DIR/msgbox -truncate" \
+'Incorporating new mail into inbox...
+
+  26+ 09/06 me@example.com     <<a >>'
+rm -f  "$MH_TEST_DIR/msgbox"
+
+# check inc (m_getfld, actually) of very, very short message
+cat >>"$MH_TEST_DIR/msgbox" <<EOF
+From 
+Date: Tue, 6 Sep 2016 08:52:32 -0400
+From: me@example.com
+
+ab
+EOF
+
+run_test "inc -width 50 -file $MH_TEST_DIR/msgbox -truncate" \
+'Incorporating new mail into inbox...
+
+  27+ 09/06 me@example.com     <<ab >>'
+rm -f  "$MH_TEST_DIR/msgbox"
+
+# check inc (m_getfld, actually) of very short message
+cat >>"$MH_TEST_DIR/msgbox" <<EOF
+From 
+Date: Tue, 6 Sep 2016 08:52:32 -0400
+From: me@example.com
+
+abc
+EOF
+
+run_test "inc -width 50 -file $MH_TEST_DIR/msgbox -truncate" \
+'Incorporating new mail into inbox...
+
+  28+ 09/06 me@example.com     <<abc >>'
+rm -f  "$MH_TEST_DIR/msgbox"
+
+# check inc (m_getfld, actually) of short message
+cat >>"$MH_TEST_DIR/msgbox" <<EOF
+From 
+Date: Tue, 6 Sep 2016 08:52:32 -0400
+From: me@example.com
+
+abcd
+EOF
+
+run_test "inc -width 50 -file $MH_TEST_DIR/msgbox -truncate" \
+'Incorporating new mail into inbox...
+
+  29+ 09/06 me@example.com     <<abcd >>'
+rm -f  "$MH_TEST_DIR/msgbox"
+
 
 exit ${failed:-0}