X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/ac36cbe491dc08965b78c6d3475b829ef517fdd0..67bb0fc0:/test/mhbuild/test-ext-params?ds=sidebyside diff --git a/test/mhbuild/test-ext-params b/test/mhbuild/test-ext-params index 96cad2e9..2268c95c 100755 --- a/test/mhbuild/test-ext-params +++ b/test/mhbuild/test-ext-params @@ -14,9 +14,10 @@ fi setup_test -LC_ALL=en_US.UTF-8; export LC_ALL +require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8 draft="$MH_TEST_DIR/$$.draft" +backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig" expected="$MH_TEST_DIR/$$.expected" # @@ -181,4 +182,77 @@ EOF check "$draft" "$expected" +# +# Test to make sure things fail if we try to put 8-bit characters when the +# locale is US-ASCII +# + +cat > "$draft" < +cc: +Fcc: +outbox +------ +This is a test message +#image/jpeg {attachment} $MH_TEST_DIR/tïny.jpg +EOF + +old_locale="$LC_ALL" +LC_ALL=C; export LC_ALL + +set +e +run_test 'eval mhbuild "$draft" 2>&1' 'mhbuild: 8-bit characters in parameter "filename", but local character set is US-ASCII' +set -e + +LC_ALL="$old_locale"; export LC_ALL + +rm -f "$MH_TEST_DIR/tïny.jpg" + +# +# Test out message/external-body decoding +# + +cat > "$draft" < +cc: +Fcc: +outbox +------ +This is a test message +#@application/octet-stream [Test of a long URL] {attachment; \ +filename=test.tar.gz} access-type=url; url="http://www.example.com/this/is/an/example/of/a/very/long/url/that-should-be-wrapped/name.tar.gz" +EOF + +run_prog mhbuild "$draft" + +cat > "$expected" < +cc: +Fcc: +outbox +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" + +------- =_aaaaaaaaaa0 +Content-Type: text/plain; charset="us-ascii" + +This is a test message + +------- =_aaaaaaaaaa0 +Content-Type: message/external-body; access-type="url"; + url*0="http://www.example.com/this/is/an/example/of/a/very/long/url"; + url*1="/that-should-be-wrapped/name.tar.gz" + +Content-Type: application/octet-stream +Content-ID: +Content-Description: Test of a long URL +Content-Disposition: attachment; filename="test.tar.gz" + +------- =_aaaaaaaaaa0-- +EOF + +sed -e 's/^Content-ID:.*/Content-ID:/' "$draft" > "${draft}.nocontentid" +rm "$draft" + +check "${draft}.nocontentid" "$expected" + +[ ${failed:=0} -eq 0 ] && rm -f ${backup} + exit ${failed:-0}