]> diplodocus.org Git - nmh/blobdiff - test/mhbuild/test-cte
More fixes (and tests) for the base64 encoder.
[nmh] / test / mhbuild / test-cte
index e3f151a5f90bd832165d6ab6b36d7092d6b21fba..517fbc51b74a10eba61b9afb17d032ce5be2f1da 100755 (executable)
@@ -45,6 +45,57 @@ Content-Transfer-Encoding: quoted-printable
 This is a test of a message with a sh=C3=B8rt line.
 EOF
 
+#
+# Force some text to be base64, to test out the encoder.  Try at different
+# line lengths to check out the padding on the 
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+#<text/plain *b64
+This is a test of a message with a shørt line.
+EOF
+
+run_prog mhbuild "$draft"
+
+cat > "$expected" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: base64
+
+VGhpcyBpcyBhIHRlc3Qgb2YgYSBtZXNzYWdlIHdpdGggYSBzaMO4cnQgbGluZS4NCg==
+EOF
+
+check "$draft" "$expected"
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+#<text/plain *b64
+This is a test of a mëssage with a shørt line.
+EOF
+
+run_prog mhbuild "$draft"
+
+cat > "$expected" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: base64
+
+VGhpcyBpcyBhIHRlc3Qgb2YgYSBtw6tzc2FnZSB3aXRoIGEgc2jDuHJ0IGxpbmUuDQo=
+EOF
+
 check "$draft" "$expected"
 
 exit ${failed:-0}