X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/ddb9e8ca47b9e881df743c4f79f631bfc14ef76a..d9d10cd9d6a48c7d64f4882b3b5dee9adf16f9e3:/test/mhfixmsg/test-mhfixmsg?ds=sidebyside diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index 61821c27..2194c7a2 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -887,6 +887,33 @@ run_test 'mhfixmsg last -outfile '"$actual"' -verbose' \ check "$expected" "$actual" +# check that message is not modified when -fixboundary fails +cat >`mhpath new` < +To: +Subject: mhfixmsg bad boundary test + +This is a multi-part message in MIME format. + +------=_ NextPart_000_1781A1A_01CC1147.81EBA8D4 +Content-Type: text/plain + +The boundary below doesn't match the header boundary. + +------=_ +NextPart_000_1781A1A_01CC1147.81EBA8D4-- +EOF + +cp -p `mhpath last` "$expected" +run_test "mhfixmsg last -outfile $actual" '' +check "$expected" "$actual" + + # check that text/plain part is not added to text/html in multipart/related # when it shouldn't be cat >`mhpath new` <"$expected.err" <`mhpath new` <"$actual.err" +set -e +#### Expected output is identical to the input message. +check `mhpath last` "$actual" 'keep first' +check "$expected.err" "$actual.err" + + +# check that input is passed through to output when there's a parse error +# (the charset string is missing its closing quote) with -outfile, and +# input from stdin. Don't check err output, because it contains the name +# of a tmp file. It's similar to that of the previous check. +set +e +run_prog mhfixmsg -file - -outfile - <`mhpath last` >"$actual" 2>/dev/null +set -e +#### Expected output is identical to the input message. +check `mhpath last` "$actual" + + # make sure there are no tmp files left over find "$MH_TEST_DIR/Mail" \( -name 'mhfix*' -o -name ',mhfix*' \) -print \ >"$actual"