]> diplodocus.org Git - nmh/blobdiff - test/mhbuild/test-ext-params
Fixed extra and missing trailing commas in SEE ALSO sections of man pages.
[nmh] / test / mhbuild / test-ext-params
index adde9d958da27bf0fba2e8c2f7c0f4833b0695b2..2268c95ca6d5ed8e2ecd1434b88c8416fc4e3850 100755 (executable)
@@ -14,7 +14,7 @@ fi
 
 setup_test
 
 
 setup_test
 
-LC_ALL=en_US.UTF-8; export LC_ALL
+require_locale en_US.UTF-8 en_US.UTF8 en_US.utf-8 en_US.utf8
 
 draft="$MH_TEST_DIR/$$.draft"
 backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
 
 draft="$MH_TEST_DIR/$$.draft"
 backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
@@ -157,7 +157,6 @@ This is a test message
 EOF
 
 run_prog mhbuild "$draft"
 EOF
 
 run_prog mhbuild "$draft"
-rm -f "$MH_TEST_DIR/tïny.jpg"
 
 cat > "$expected" <<EOF
 To: Mr Test <mrtest@example.com>
 
 cat > "$expected" <<EOF
 To: Mr Test <mrtest@example.com>
@@ -183,6 +182,31 @@ EOF
 
 check "$draft" "$expected"
 
 
 check "$draft" "$expected"
 
+#
+# Test to make sure things fail if we try to put 8-bit characters when the
+# locale is US-ASCII
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+This is a test message
+#image/jpeg {attachment} $MH_TEST_DIR/tïny.jpg
+EOF
+
+old_locale="$LC_ALL"
+LC_ALL=C; export LC_ALL
+
+set +e
+run_test 'eval mhbuild "$draft" 2>&1' 'mhbuild: 8-bit characters in parameter "filename", but local character set is US-ASCII'
+set -e
+
+LC_ALL="$old_locale"; export LC_ALL
+
+rm -f "$MH_TEST_DIR/tïny.jpg"
+
 #
 # Test out message/external-body decoding
 #
 #
 # Test out message/external-body decoding
 #
@@ -217,13 +241,17 @@ Content-Type: message/external-body; access-type="url";
        url*1="/that-should-be-wrapped/name.tar.gz"
 
 Content-Type: application/octet-stream
        url*1="/that-should-be-wrapped/name.tar.gz"
 
 Content-Type: application/octet-stream
+Content-ID:
 Content-Description: Test of a long URL
 Content-Disposition: attachment; filename="test.tar.gz"
 
 ------- =_aaaaaaaaaa0--
 EOF
 
 Content-Description: Test of a long URL
 Content-Disposition: attachment; filename="test.tar.gz"
 
 ------- =_aaaaaaaaaa0--
 EOF
 
-check "$draft" "$expected"
+sed -e 's/^Content-ID:.*/Content-ID:/' "$draft" > "${draft}.nocontentid"
+rm "$draft"
+
+check "${draft}.nocontentid" "$expected"
 
 [ ${failed:=0} -eq 0 ]  &&  rm -f ${backup}
 
 
 [ ${failed:=0} -eq 0 ]  &&  rm -f ${backup}