]> diplodocus.org Git - nmh/blobdiff - test/post/test-messageid
Replaced individual assignment of array elements, one of which was
[nmh] / test / post / test-messageid
index 45f75d0cdc5825ac5ed3bce58c0774396fcbf47d..6ca8f97ea2b9da6435811a2853e60e802f96d8ee 100755 (executable)
@@ -32,6 +32,8 @@ DATA
 From: Mr Nobody <nobody@example.com>
 To: Somebody Else <somebody@example.com>
 Subject: Test
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
 Date:
 
 This is a test
@@ -47,7 +49,7 @@ send: message not delivered to anyone"
 #### Rely on sendmail/pipe below to override default mts.
 mts_fakesendmail="${MHMTSCONF}-fakesendmail"
 cp "${MHMTSCONF}" "$mts_fakesendmail"
-printf "%s\n" "sendmail: ${srcdir}/test/fakesendmail" >>"$mts_fakesendmail"
+printf 'sendmail: %s/test/fakesendmail\n' "$srcdir" >>"$mts_fakesendmail"
 MHMTSCONF="$mts_fakesendmail"
 
 # $1: -messageid switch selection
@@ -55,7 +57,7 @@ MHMTSCONF="$mts_fakesendmail"
 test_messageid ()
 {
   msgid_style="$1"
-  send -draft -mts sendmail/pipe -msgid -messageid "$msgid_style"
+  run_prog send -draft -mts sendmail/pipe -msgid -messageid "$msgid_style"
   shift
 
   # fakesendmail drops the message and any cc's into this mbox.
@@ -77,15 +79,15 @@ test_messageid ()
         # e.g., Message-ID: <5364-1342884222.165897@ldYM.FXwU.bBqK>
         id='^Message-ID: <[0-9]\{1,\}-[0-9]\{1,\}\.[0-9]\{6,6\}@[-_0-9A-Za-z]\{4,4\}\.[-_0-9A-Za-z]\{4,4\}\.[-_0-9A-Za-z]\{4,4\}'
         ;;
-      *)         printf "$0: unexpected messageid: $msgid_style"; exit 1;;
+      *) printf '%s: unexpected messageid: %s\n' "$0" "$msgid_style"; exit 1 ;;
     esac
 
     if grep "$id" "$cur" >/dev/null; then
       :
     else
       mv "$cur" "${testname}.actual"
-      printf "$0: unexpected "$msgid_style" Message-ID format, \
-see ${testname}.actual\n"
+      printf '%s: unexpected %s Message-ID format, see %s\n' "$0" \
+             "$msgid_style" "${testname}.actual"
       exit 1
     fi
 
@@ -122,6 +124,8 @@ cat > "${testname}.expected" <<EOF
 From: Mr Nobody <nobody@example.com>
 To: Somebody Else <somebody@example.com>
 Subject: Test
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
 Date:
 Message-ID:
 
@@ -145,6 +149,8 @@ cat > "${testname}.expected" <<EOF
 From: Mr Nobody <nobody@example.com>
 To: Somebody Else <somebody@example.com>
 Subject: Test
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
 Date:
 Message-ID: