X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Fmhmail%2Ftest-mhmail;h=5a7117bb1621b1dcf3b8ab32efc36506c5897ebf;hb=374ece2e88368afd6e0a29c4ee4b75ffa9e28b39;hp=e8fbac8ae3018bb1f335182617757eda7c234435;hpb=26d1d48706344c9311fe19f3691e5c0a230da710;p=mmh diff --git a/test/mhmail/test-mhmail b/test/mhmail/test-mhmail index e8fbac8..5a7117b 100755 --- a/test/mhmail/test-mhmail +++ b/test/mhmail/test-mhmail @@ -73,13 +73,13 @@ actual_err=$MH_TEST_DIR/test-mhmail$$.actual_err # check -help # Verified behavior consistent with compiled sendmail. cat >$expected <$actual 2>&1 @@ -102,8 +103,22 @@ case `mhmail -v` in failed=`expr ${failed:-0} + 1`;; esac - -# check with no arguments +# check for missing argument to switches that require them +for switch in attach body cc from headerfield subject to; do + run_test "mhmail recipient -$switch" \ + "mhmail: missing argument to -$switch" +done +for switch in attach body cc from headerfield subject to; do + run_test "mhmail recipient -$switch -nosend" \ + "mhmail: missing argument to -$switch" +done +for switch in attach body cc from headerfield subject to; do + run_test "mhmail recipient -$switch -server 127.0.0.1" \ + "mhmail: missing argument to -$switch" +done + + +# check with no switches # That will just run inc, which we don't want to do anything, # so tell inc to just display its version. # Verified same behavior as compiled mhmail. @@ -294,7 +309,7 @@ test_mhmail "$expected" '-from sender@localhost -profile' '|' message [ ${failed:-0} -eq 0 ] || exit ${failed:-0} -# check repeated -from and -subject arguments +# check repeated -from and -subject switches # Verified same behavior as compiled mhmail. cat > "$expected" < "$expected" < "$expected" < "$expected" < +RCPT TO: +RCPT TO: +RCPT TO: +DATA +To: recipient@example.com, recipient2@example.com +Cc: cc1@example.com +Subject: Test +From: sender@localhost +Date: + +message +. +QUIT +EOF + +test_mhmail "$expected" \ + "-from sender@localhost -cc cc1@example.com -subject Test \ + -to recipient2@example.com" \ + -b message +[ ${failed:-0} -eq 0 ] || exit ${failed:-0} + + # check with no newline on stdin # Shows different behavior than compiled mhmail, which was silent in this case. cat > "$expected" < "$expected" < "$expected" <