]> diplodocus.org Git - nmh/commitdiff
Added test/mhl/test-rfc6532.
authorDavid Levine <levinedl@acm.org>
Wed, 21 Sep 2016 15:54:49 +0000 (11:54 -0400)
committerDavid Levine <levinedl@acm.org>
Wed, 21 Sep 2016 15:54:49 +0000 (11:54 -0400)
Makefile.am
test/mhl/test-rfc6532 [new file with mode: 0755]

index 616d7dd..0db9cfb 100644 (file)
@@ -78,7 +78,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/mhbuild/test-forw test/mhbuild/test-header-encode \
        test/mhbuild/test-utf8-body \
        test/mhfixmsg/test-mhfixmsg test/mhical/test-mhical \
-       test/mhl/test-mhl-flags \
+       test/mhl/test-mhl-flags test/mhl/test-rfc6532 \
        test/mhlist/test-mhlist test/mhlist/test-ext-params \
        test/mhmail/test-mhmail \
        test/mhparam/test-mhparam test/mhpath/test-mhpath \
diff --git a/test/mhl/test-rfc6532 b/test/mhl/test-rfc6532
new file mode 100755 (executable)
index 0000000..fb98604
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+######################################################
+#
+# Test compatibility with RFC 6532, Internationalized
+#   Email Headers
+#
+######################################################
+
+set -e
+
+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
+
+#### Make sure that html-to-text conversion is what we expect.
+require_locale en_US.utf-8 en_US.utf8
+LC_ALL=en_US.UTF-8; export LC_ALL
+
+
+# check UTF-8 headers
+start_test 'UTF-8 headers'
+cat >"$MH_TEST_DIR"/Mail/inbox/11 <<EOF
+From: receiverø@example.com
+To: senderæ@example.com
+Subject: Blåbærsyltetøy
+Date: 20 May 2014 14:28:51 +0200
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+Blåbærsyltetøy er veldig godt. Jeg liker blåbærsyltetøy.
+Jøran.
+
+Text source:
+Arnt Gulbrandsen and Jiankang Yao, "Email Address Internationalization",
+Computing Edge 1:6, June 2015,
+http://www.computer.org/cms/computing-edge/ce-jun15-final.pdf, p. 50.
+EOF
+
+#### Just check that the (UTF-8) headers are displayed unscathed.  run_test
+#### squashes the trailing blank lines from mhl.
+run_test "mhl -form mhl.headers `mhpath last`" \
+'Date:    20 May 2014 14:28:51 +0200
+To:      senderæ@example.com
+From:    receiverø@example.com
+Subject: Blåbærsyltetøy'
+
+
+finish_test
+exit $failed