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 expected_err=$MH_TEST_DIR/$$.expected_err
24 actual=$MH_TEST_DIR/$$.actual
25 actual_err=$MH_TEST_DIR/$$.actual_err
30 Usage: rcvpack [switches] file
38 $rcvpack -help >$actual 2>&1
39 check $expected $actual
44 * ) printf "$0: rcvpack -v generated unexpected output\n" >&2
45 failed=`expr ${failed:-0} + 1`;;
48 # check unknown switch
49 run_test "$rcvpack -nonexistent" 'rcvpack: -nonexistent unknown'
51 # check with no switches
52 run_test "$rcvpack" 'rcvpack: rcvpack [switches] file'
55 $rcvpack <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox
56 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
57 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
60 $rcvpack -mmdf -mbox <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox2
61 check "${MH_TEST_DIR}/Mail/mbox" "${MH_TEST_DIR}/Mail/mbox2" 'keep first'
63 # check append to existing mbox file
64 $rcvpack <${MH_TEST_DIR}/Mail/inbox/2 ${MH_TEST_DIR}/Mail/mbox
65 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
66 check "${MH_TEST_DIR}/Mail/inbox/2" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
69 $rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/3 ${MH_TEST_DIR}/Mail/mmdf
70 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
71 check "${MH_TEST_DIR}/Mail/inbox/3" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
73 # check append to existing mmdf file
74 $rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/4 ${MH_TEST_DIR}/Mail/mmdf
75 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
76 check "${MH_TEST_DIR}/Mail/inbox/4" "${MH_TEST_DIR}/Mail/inbox/13" 'keep first'