From: Ken Hornstein Date: Tue, 25 Feb 2014 02:34:12 +0000 (-0500) Subject: Beginnings of test suite for RFC 2231 support; does not work yet. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/457f595e905f57b1424fc5e7d4159228cffb127e Beginnings of test suite for RFC 2231 support; does not work yet. --- diff --git a/Makefile.am b/Makefile.am index bdcca089..bf933ef3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,6 +67,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \ test/manpages/test-manpages \ test/mhbuild/test-attach \ test/mhbuild/test-cte \ + test/mhbuild/test-ext-params \ test/mhbuild/test-forw test/mhbuild/test-header-encode \ test/mhbuild/test-utf8-body \ test/mhfixmsg/test-mhfixmsg \ diff --git a/test/mhbuild/test-ext-params b/test/mhbuild/test-ext-params new file mode 100755 index 00000000..74253f41 --- /dev/null +++ b/test/mhbuild/test-ext-params @@ -0,0 +1,51 @@ +#!/bin/sh +###################################################### +# +# Test the creation of RFC 2231 encoded parameters +# +###################################################### + +if test -z "${MH_OBJ_DIR}"; then + srcdir=`dirname "$0"`/../.. + MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR +fi + +. "$MH_OBJ_DIR/test/common.sh" + +setup_test + +LC_ALL=en_US.UTF-8; export LC_ALL + +draft="$MH_TEST_DIR/$$.draft" +expected="$MH_TEST_DIR/$$.expected" + +# +# Try out a draft with some 8-bit encoded parameters +# + +cat > "$draft" < +cc: +------ +This is a test message +#image/jpeg {attachment; filename="tïny.jpg"} ${srcdir}/test/mhbuild/tiny.jpg +EOF + +run_prog mhbuild "$draft" + +cat > "$expected" < +cc: +Fcc: +outbox +MIME-Version: 1.0 +Content-Type: image/jpeg; name="tiny.jpg" +Content-Description: tiny.jpg +Content-Disposition: attachment; filename="tiny.jpg" +Content-Transfer-Encoding: base64 + +/9g= +EOF + +check "$draft" "$expected" + +exit ${failed:-0}