# check -help
+start_test "-help"
cat >"$expected" <<EOF
Usage: packf [+folder] [msgs] [switches]
switches are:
check "$expected" "$actual"
# check -version
+start_test "-version"
case `packf -v` in
packf\ --*) ;;
* ) printf '%s: packf -v generated unexpected output\n' "$0" >&2
esac
# check unknown switch
+start_test "unknown switch"
run_test "packf -nonexistent" 'packf: -nonexistent unknown'
cd "${MH_TEST_DIR}" || exit 1
printf 'y\n' >Mail/yes
# check with no switches
+start_test "with no switches"
run_prog packf <Mail/yes
inc +inbox2 -file msgbox <Mail/yes >/dev/null
rm -f msgbox
rmm +inbox2 -unlink `pick +inbox2`
# check +folder
+start_test "+folder"
run_prog packf +inbox <Mail/yes
inc +inbox2 -file msgbox >/dev/null
rm -f msgbox
rmm +inbox2 -unlink `pick +inbox2`
# check msgs
+start_test "msgs"
run_prog packf +inbox 1 2 3 <Mail/yes
inc +inbox2 -file msgbox >/dev/null
rm -f msgbox
rmm +inbox2 -unlink `pick +inbox2`
# check -file
+start_test "-file"
run_prog packf +inbox -file msgbox2 <Mail/yes
inc +inbox2 -file msgbox2 >/dev/null
for i in `pick +inbox2`; do
rmm +inbox2 -unlink `pick +inbox2`
# check append to existing mbox file
+start_test "append to existing mbox file"
run_prog packf +inbox -file msgbox2 <Mail/yes
inc +inbox2 -file msgbox2 >/dev/null
rm -f msgbox2
rmm +inbox2 -unlink `pick +inbox2`
# check -mbox
+start_test "-mbox"
run_prog packf +inbox -mbox <Mail/yes
inc +inbox2 -file msgbox >/dev/null
rm -f msgbox
rmm +inbox2 -unlink `pick +inbox2`
# check -mmdf
+start_test "-mmdf"
run_prog packf +inbox -mmdf <Mail/yes
inc +inbox2 -file msgbox >/dev/null
rm -f msgbox
rmm +inbox2 -unlink `pick +inbox2`
# check append to existing mmdf file
+start_test "append to existing mmdf file"
run_prog packf +inbox -mmdf <Mail/yes
inc +inbox2 -file msgbox >/dev/null
rm -f msgbox
rmm +inbox2 -unlink `pick +inbox2`
+finish_test
exit ${failed:-0}