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_LIBEXEC_DIR}/rcvpack"
22 expected="$MH_TEST_DIR/$$.expected"
23 actual="$MH_TEST_DIR/$$.actual"
27 cat >"$expected" <<EOF
28 Usage: rcvpack [switches] file
36 #### Skip nmh intro text.
37 run_prog "$rcvpack" -help | sed '/^$/,$d' >"$actual" 2>&1
38 check "$expected" "$actual"
43 * ) printf '%s: rcvpack -v generated unexpected output\n' "$0" >&2
44 failed=`expr ${failed:-0} + 1`;;
47 # check unknown switch
48 run_test "$rcvpack -nonexistent" 'rcvpack: -nonexistent unknown'
50 # check with no switches
51 run_test "$rcvpack" 'rcvpack: rcvpack [switches] file'
54 run_prog $rcvpack <${MH_TEST_DIR}/Mail/inbox/1 ${MH_TEST_DIR}/Mail/mbox
55 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
56 check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first'
59 run_prog $rcvpack -mmdf -mbox ${MH_TEST_DIR}/Mail/mbox2 \
60 <${MH_TEST_DIR}/Mail/inbox/1
61 # Filter out "From " lines because their timestamps can differ by a second.
62 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox" >"${MH_TEST_DIR}/Mail/mbox-filt"
63 grep -v '^From ' "${MH_TEST_DIR}/Mail/mbox2" >"${MH_TEST_DIR}/Mail/mbox2-filt"
64 check "${MH_TEST_DIR}/Mail/mbox-filt" "${MH_TEST_DIR}/Mail/mbox2-filt"
66 # check append to existing mbox file
67 run_prog $rcvpack <${MH_TEST_DIR}/Mail/inbox/2 ${MH_TEST_DIR}/Mail/mbox
68 inc -file ${MH_TEST_DIR}/Mail/mbox -silent
69 check "${MH_TEST_DIR}/Mail/inbox/2" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
72 run_prog $rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/3 ${MH_TEST_DIR}/Mail/mmdf
73 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
74 check "${MH_TEST_DIR}/Mail/inbox/3" "${MH_TEST_DIR}/Mail/inbox/12" 'keep first'
76 # check append to existing mmdf file
77 run_prog $rcvpack -mmdf <${MH_TEST_DIR}/Mail/inbox/4 ${MH_TEST_DIR}/Mail/mmdf
78 inc -file ${MH_TEST_DIR}/Mail/mmdf -silent
79 check "${MH_TEST_DIR}/Mail/inbox/4" "${MH_TEST_DIR}/Mail/inbox/13" 'keep first'