EOF
# check -help
+start_test "-help"
# Only look at first 10 lines because the rest depend on
# whether sasl support was configured in.
cat >$expected <<EOF
check $expected $actual
# check -version
+start_test "-version"
case `whom -v` in
whom\ --*) ;;
* ) echo "$0: whom -v generated unexpected output" 1>&2
esac
# check with no options
+start_test "with no options"
run_test 'whom' ' -- Network Recipients --
user at example.com'
# check -nocheck
+start_test "-nocheck"
run_test 'whom -check -nocheck' ' -- Network Recipients --
user at example.com'
# check with file specified
+start_test "with file specified"
run_test "whom $MH_TEST_DIR/Mail/draft" ' -- Network Recipients --
user at example.com'
# check -draftmessage
+start_test "-draftmessage"
run_test "whom -draftm draft" ' -- Network Recipients --
user at example.com'
# check -draftfolder with -draftmessage
+start_test "-draftfolder with -draftmessage"
folder +drafts -create >/dev/null
folder +inbox -fast >/dev/null
cp $MH_TEST_DIR/Mail/draft $MH_TEST_DIR/Mail/drafts/1
user at example.com'
# check -draftfolder with current draftmessage
+start_test "-draftfolder with current draftmessage"
folder +drafts 1 >/dev/null
run_test "whom -draftfolder +drafts" \
' -- Network Recipients --
user at example.com'
# check -nodraftfolder
+start_test "-nodraftfolder"
run_test 'whom -draftfolder +nonexistent -nodraftfolder' \
' -- Network Recipients --
user at example.com'
# check -draft, though I'm not sure that it's useful. Note that it
+start_test "-draft, though I'm not sure that it's useful. Note that it"
# must appear after the file argument when run standalone.
run_test "whom $MH_TEST_DIR/Mail/drafts/1 -draft" \
' -- Network Recipients --
user at example.com'
# check -alias
+start_test "-alias"
rm -f $MH_TEST_DIR/Mail/draft
cat >$MH_TEST_DIR/Mail/draft <<'EOF'
From: Test1 <test1@example.com>
user1 at example.com'
# check -alias with nonexistent aliasfile
+start_test "-alias with nonexistent aliasfile"
run_test 'whom -alias nonexistent' \
"whom: aliasing error in nonexistent - unable to read 'nonexistent'"
+finish_test
exit $failed