]>
diplodocus.org Git - nmh/blob - test/rcv/test-rcvpack
2 ######################################################
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"$MH_OBJ_DIR/test/common.sh"
19 # Use proper program, likely not the first one on PATH.
20 rcvpack
="${MH_LIB_DIR}/rcvpack"
22 expected
="$MH_TEST_DIR/$$.expected"
23 actual
="$MH_TEST_DIR/$$.actual"
27 cat >"$expected" <<EOF
28 Usage: rcvpack [switches] file
36 $rcvpack -help >"$actual" 2>&1
37 check
"$expected" "$actual"
42 * ) printf "$0: rcvpack -v generated unexpected output\n" >&2
43 failed
=`expr ${failed:-0} + 1`;;
46 # check unknown switch
47 run_test
"$rcvpack -nonexistent" 'rcvpack: -nonexistent unknown'
49 # check with no switches
50 run_test
"$rcvpack" 'rcvpack: rcvpack [switches] file'
53 $rcvpack <${MH_TEST_DIR}/Mail
/inbox
/1 ${MH_TEST_DIR}/Mail
/mbox
54 inc
-file ${MH_TEST_DIR}/Mail
/mbox
-silent
55 check
"${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
58 $rcvpack -mmdf -mbox <${MH_TEST_DIR}/Mail
/inbox
/1 ${MH_TEST_DIR}/Mail
/mbox2
59 # Filter out "From " lines because their timestamps can differ by a second.
60 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox" >"${MH_TEST_DIR}/Mail/mbox-filt"
61 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox2" >"${MH_TEST_DIR}/Mail/mbox2-filt"
62 check
"${MH_TEST_DIR}/Mail/mbox-filt" "${MH_TEST_DIR}/Mail/mbox2-filt"
64 # check append to existing mbox file
65 $rcvpack <${MH_TEST_DIR}/Mail
/inbox
/2 ${MH_TEST_DIR}/Mail
/mbox
66 inc
-file ${MH_TEST_DIR}/Mail
/mbox
-silent
67 check
"${MH_TEST_DIR}/Mail/inbox/2" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
70 $rcvpack -mmdf <${MH_TEST_DIR}/Mail
/inbox
/3 ${MH_TEST_DIR}/Mail
/mmdf
71 inc
-file ${MH_TEST_DIR}/Mail
/mmdf
-silent
72 check
"${MH_TEST_DIR}/Mail/inbox/3" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
74 # check append to existing mmdf file
75 $rcvpack -mmdf <${MH_TEST_DIR}/Mail
/inbox
/4 ${MH_TEST_DIR}/Mail
/mmdf
76 inc
-file ${MH_TEST_DIR}/Mail
/mmdf
-silent
77 check
"${MH_TEST_DIR}/Mail/inbox/4" "${MH_TEST_DIR}/Mail/inbox/13" 'keep first'