]> diplodocus.org Git - nmh/blobdiff - test/mhbuild/test-ext-params
Re-do length calculation for parameter output, and adapt test for new code.
[nmh] / test / mhbuild / test-ext-params
index 74253f4167819119379084ff0e0b39fe7cb2471d..5e4a681b37aa8fb70761c8941d5b0ed21f93be27 100755 (executable)
@@ -26,6 +26,7 @@ expected="$MH_TEST_DIR/$$.expected"
 cat > "$draft" <<EOF
 To: Mr Test <mrtest@example.com>
 cc:
+Fcc: +outbox
 ------
 This is a test message
 #image/jpeg {attachment; filename="tïny.jpg"} ${srcdir}/test/mhbuild/tiny.jpg
@@ -38,12 +39,106 @@ To: Mr Test <mrtest@example.com>
 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-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+
+This is a test message
+
+------- =_aaaaaaaaaa0
+Content-Type: image/jpeg
+Content-Disposition: attachment; filename*=UTF-8''t%C3%AFny.jpg
+Content-Transfer-Encoding: base64
+
+/9g=
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
+#
+# Try out a draft with some long parameters
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+This is a test message
+#image/jpeg {attachment; filename="This is an example of a rather long filename that is longer than would fit on a normal line.jpg"} \
+${srcdir}/test/mhbuild/tiny.jpg
+EOF
+
+run_prog mhbuild "$draft"
+
+cat > "$expected" <<EOF
+To: Mr Test <mrtest@example.com>
+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: image/jpeg
+Content-Disposition: attachment;
+       filename*0="This is an example of a rather long filename that is lo";
+       filename*1="nger than would fit on a normal line.jpg"
+Content-Transfer-Encoding: base64
+
+/9g=
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
+#
+# Try out both!
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+This is a test message
+#image/jpeg {attachment; filename="This is an ëxample of a rather long filename that is longer than would fit on a normal line.jpg"} \
+${srcdir}/test/mhbuild/tiny.jpg
+EOF
+
+run_prog mhbuild "$draft"
+
+cat > "$expected" <<EOF
+To: Mr Test <mrtest@example.com>
+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: image/jpeg
+Content-Disposition: attachment;
+       filename*0*=UTF-8''This%20is%20an%20%C3%ABxample%20of%20a%20rather;
+       filename*1=" long filename that is longer than would fit on a norma";
+       filename*2="l line.jpg"
 Content-Transfer-Encoding: base64
 
 /9g=
+
+------- =_aaaaaaaaaa0--
 EOF
 
 check "$draft" "$expected"