#!/bin/sh # # Check to see if the scan output is correct if we have a message # right on the stdio buffer boundary # set -e if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi . "$MH_OBJ_DIR/test/common.sh" setup_test thisdir="$srcdir/test/inc" expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/$$.actual" cat > "${MH_TEST_DIR}/test.mbox" < To: Another Nobody Date: Thu, 1 Mar 2012 01:02:03 -0500 Subject: Who is on first? Abbott: Every dollar of it. And why not, the man's entitled to it. Costello: Who is? Abbott: Yes. Costello: So who gets it? Abbott: Why shouldn't he? Sometimes his wife comes down and collects it. Costello: Who's wife? Abbott: Yes. After all, the man earns it. Costello: Who does? Abbott: Absolutely. Costello: Well, all I'm trying to find out is what's the guy's name on first base? Abbott: Oh, no, no. What is on second base. Costello: I'm not asking you who's on second. Abbott: Who's on first! EOF cat > "${MH_TEST_DIR}/test.mbox.2" < To: Another Nobody Date: Thu, 1 Mar 2012 01:02:03 -0500 Subject: Who is on first? Abbott: Every dollar of it. And why not, the man's entitled to it. Costello: Who is? Abbott: Yes. Costello: So who gets it? Abbott: Why shouldn't he? Sometimes his wife comes down and collects it. Costello: Who's wife? Abbott: Yes. After all, the man earns it. Costello: Who does? Abbott: Absolutely. Costello: Well, all I'm trying to find out is what's the guy's name on first base? Abbott: Oh, no, no. What is on second base. Costello: I'm not asking you who's on second. Abbott: Who's on first! 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?<"$MH_TEST_DIR/mess" < To: Some Other User Subject: all that and nothing to say? Date: Thu, 10 Jan 2013 19:54:01 -0500 EOF run_test 'scan -width 60 -file '"$MH_TEST_DIR/mess" \ ' 1 01/10 No Such User all that and nothing to say?' rm -f "$MH_TEST_DIR/mess" # 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` <"$MH_TEST_DIR/mess" < To: Some Other User Subject: FLDPLUS test Date: Wed, 16 Jan 2013 20:33:58 -0600 EOF 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 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" \ ' 1 09/29 Test1 Testing message 1<> 2 09/29 Test2 Testing message 2<> 3 09/29 Test3 Testing message 3<> 4 09/29 Test4 Testing message 4<> 5 09/29 Test5 Testing message 5<> 6 09/29 Test6 Testing message 6<> 7 09/29 Test7 Testing message 7<> 8 09/29 Test8 Testing message 8<> 9 09/29 Test9 Testing message 9<> 10 09/29 Test10 Testing message 10<> 11 03/01 Mr Nobody Who is on first?<> 14 09/29 Test2 Testing message 2<> 15 09/29 Test3 Testing message 3<> 16 09/29 Test4 Testing message 4<> 17 09/29 Test5 Testing message 5<> 18 09/29 Test6 Testing message 6<> 19 09/29 Test7 Testing message 7<> 20 09/29 Test8 Testing message 8<> 21 09/29 Test9 Testing message 9<> 22 09/29 Test10 Testing message 10<> 23 03/01 Mr Nobody Who is on first?<>"$MH_TEST_DIR/msgbox" <>' rm -f "$MH_TEST_DIR/msgbox" exit ${failed:-0}