X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=test%2Ftests%2Fmhbuild%2Ftest-header-encode;h=047f7dc1d9b76d0a907acda0ba8a42136b4c07b1;hp=422f970777ceb715bfb61786bb3d3117a896f19e;hb=82325c1114254a76b8285bb710b2f651674331c7;hpb=9c61a657f72aa43b4a2f4e027ad84e7f65fb66cb diff --git a/test/tests/mhbuild/test-header-encode b/test/tests/mhbuild/test-header-encode index 422f970..047f7dc 100644 --- a/test/tests/mhbuild/test-header-encode +++ b/test/tests/mhbuild/test-header-encode @@ -5,39 +5,25 @@ # ###################################################### -# TODO: Move to a common file tests can source; need more framework... -failed=0 +. "$MH_TEST_COMMON" + +draft="$MH_TEST_DIR/mhbuild-$$.draft" export MM_CHARSET=UTF-8 -check() { - diff -u $expected $actual - if [ $? -ne 0 ]; then - failed=$((failed + 1)) - fi -} - -# Make a draft file forwarding two messages. -mkdraft() { - cat > $draft <"$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 +runandcheck 'mhbuild "$draft"' < $expected </" "$draft"' < To: Somebody Subject: =?UTF-8?Q?This_is_=C3=A4_test?= @@ -46,10 +32,29 @@ Content-Type: text/plain; charset="us-ascii" Content-ID: This is a test -EOF -mkdraft -mhbuild $draft -mungedraft -check +! -exit $failed + +# To + From + +cat >"$draft" < +To: Gönül +Subject: Names with Umlauts + +This is a test +! + +runandcheck 'mhbuild "$draft"' </" "$draft"' < +To: =?UTF-8?Q?G=C3=B6n=C3=BCl?= +Subject: Names with Umlauts +MIME-Version: 1.0 +Content-Type: text/plain; charset="us-ascii" +Content-ID: + +This is a test +!