X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e8d7f6f0c0f155ccf67c10b655333cbd286fa844..afea511a759408f44ac37493df8944d6c5cf2d69:/test/mhfixmsg/test-mhfixmsg diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index b3c00090..f7f47b90 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -12,7 +12,9 @@ if test -z "${MH_OBJ_DIR}"; then MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR fi -. "${srcdir}/test/post/test-post-common.sh" +. "${MH_OBJ_DIR}/test/common.sh" + +setup_test #### Make sure that html-to-text conversion is what we expect. require_locale en_US.utf-8 en_US.utf8 @@ -23,10 +25,12 @@ expected_err="$MH_TEST_DIR/test-mhfixmsg$$.expected_err" actual="$MH_TEST_DIR/test-mhfixmsg$$.actual" actual_err="$MH_TEST_DIR/test-mhfixmsg$$.actual_err" -if grep mhfixmsg-format-text/html "${MH_TEST_DIR}/Mail/mhn.defaults" \ +mhn_defaults="$MH_INST_DIR${nmhetcdir}/mhn.defaults" + +if grep mhfixmsg-format-text/html "${mhn_defaults}" \ >/dev/null; then can_reformat_texthtml=1 - if grep 'mhfixmsg-format-text/html.*w3m' "${MH_TEST_DIR}/Mail/mhn.defaults" \ + if grep 'mhfixmsg-format-text/html.*w3m' "${mhn_defaults}" \ >/dev/null; then #### w3m uses $HOME/.w3m/, and creates it if it doesn't exist. To #### support testing with non-writeable $HOME, and to not leave @@ -42,7 +46,6 @@ fi # check -help -# Verified behavior consistent with compiled sendmail. cat >"$expected" <&2 @@ -466,8 +469,7 @@ This is additional content before the first subpart of the multipart. ------- =_aaaaaaaaaa0 Content-Type: multipart/related; - type="multipart/alternative"; - boundary="subpart__1.1" + type="text/plain"; boundary="subpart__1.1" --subpart__1.1 Content-Type: text/plain; charset="iso-8859-1" @@ -516,8 +518,7 @@ This is additional content before the first subpart of the multipart. ------- =_aaaaaaaaaa0 Content-Type: multipart/related; - type="multipart/alternative"; - boundary="subpart__1.1" + type="text/plain"; boundary="subpart__1.1" --subpart__1.1 Content-Type: text/plain; charset="iso-8859-1" @@ -794,24 +795,16 @@ run_test 'mhfixmsg last -outfile '"$actual"' -verbose' \ check "$expected" "$actual" -# check that text/plain part is added to lone text/html in multipart/related -prepare_space >"$expected" <`mhpath new` < -------=_nmh-multipart1-- - ------=_Part_90310_101292502.1 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit @@ -835,12 +826,30 @@ Your email client does not support HTML messages ------=_Part_90310_101292502.1-- EOF -cat >`mhpath new` <"$actual" + check "$expected" "$actual" 'ignore space' +else + rm -f "$expected" +fi + + +# check that text/plain part is added to text/html in multipart/related +# when it should be +cat >"$expected" < + +------=_Part_90310_101292502.1-- +EOF + +cat >`mhpath new` < + + HTML Content + + + This is the real content. + + + ------=_Part_90310_101292502.1-- EOF @@ -1066,6 +1094,58 @@ run_prog mhfixmsg last -replacetextplain -noreplacetextplain -outfile "$actual" check "$expected" "$actual" +# check removal of extraneous trailing semicolon from header parameter list +cat >"$expected" <`mhpath new` <"$MH_TEST_DIR/Mail/rmmproc" <<'EOF' mv "$1" "$1.backup" @@ -1095,6 +1175,41 @@ if test -f '${MH_TEST_DIR}/Mail/inbox/20.backup'; then fi +# check -fixtype +cat >"$expected" <`mhpath new` <"$actual"