]> diplodocus.org Git - nmh/commitdiff
Add a new (but incomplete) test for mhbuild's new functionality.
authorKen Hornstein <kenh@pobox.com>
Tue, 4 Feb 2014 02:46:33 +0000 (21:46 -0500)
committerKen Hornstein <kenh@pobox.com>
Tue, 4 Feb 2014 02:46:33 +0000 (21:46 -0500)
Makefile.am
test/mhbuild/test-cte [new file with mode: 0755]

index 626fd829b636246c2a5d9185b989c10e52d0fc04..bdcca08926929a7935f7c1d9853dead7724cf104 100644 (file)
@@ -66,6 +66,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/locking/test-datalocking test/locking/test-spoollocking \
        test/manpages/test-manpages \
        test/mhbuild/test-attach \
        test/locking/test-datalocking test/locking/test-spoollocking \
        test/manpages/test-manpages \
        test/mhbuild/test-attach \
+       test/mhbuild/test-cte \
        test/mhbuild/test-forw test/mhbuild/test-header-encode \
        test/mhbuild/test-utf8-body \
        test/mhfixmsg/test-mhfixmsg \
        test/mhbuild/test-forw test/mhbuild/test-header-encode \
        test/mhbuild/test-utf8-body \
        test/mhfixmsg/test-mhfixmsg \
diff --git a/test/mhbuild/test-cte b/test/mhbuild/test-cte
new file mode 100755 (executable)
index 0000000..e3f151a
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+#########################################################
+#
+# Test the use of explicit Content-Transfer-Encoding tags
+#
+#########################################################
+
+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"
+
+#
+# Force some text to be quoted-printable
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+#<text/plain *qp
+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: quoted-printable
+
+This is a test of a message with a sh=C3=B8rt line.
+EOF
+
+check "$draft" "$expected"
+
+exit ${failed:-0}