X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Ftests%2Fmhbuild%2Ftest-header-encode;fp=test%2Ftests%2Fmhbuild%2Ftest-header-encode;h=9049f6fa4862f6950ccde57905abed5165f417cd;hb=3cbdaea22c94d1c1d13e11b1ea6e55d3d9408771;hp=0000000000000000000000000000000000000000;hpb=0595979e1f0514b3da28762f336b3b9ac9eec5c5;p=mmh diff --git a/test/tests/mhbuild/test-header-encode b/test/tests/mhbuild/test-header-encode new file mode 100644 index 0000000..9049f6f --- /dev/null +++ b/test/tests/mhbuild/test-header-encode @@ -0,0 +1,54 @@ +#!/bin/sh +###################################################### +# +# Test encoding headers according to RFC 2047 +# +###################################################### + +# TODO: Move to a common file tests can source; need more framework... +failed=0 +check() { + diff -u $expected $actual + if [ $? -ne 0 ]; then + failed=$((failed + 1)) + fi +} + +# Make a draft file forwarding two messages. +mkdraft() { + cat > $draft < +To: Somebody +Subject: This is ä test + +This is a test +EOF +} + +# Munge the Content-Id from the draft after mhbuild, so we have a reliable +# value to check. +mungedraft() { + sed 's/\(Content-ID:\) <[^>][^>]*>/\1 /' $draft > $actual +} + +draft=$MH_TEST_DIR/$$.draft +expected=$MH_TEST_DIR/$$.expected +actual=$MH_TEST_DIR/$$.actual + +# check mhbuild +cat > $expected < +To: Somebody +Subject: =?UTF-8?Q?This_is_=C3=A4_test?= +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-ID: + +This is a test +EOF +mkdraft +mhbuild $draft +mungedraft +check + +exit $failed