]> diplodocus.org Git - nmh/blobdiff - test/post/test-sendfiles
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / test / post / test-sendfiles
index 687c5d9b7099ac694759f28aae458f1efc16e138..4e2eb612c97e0d05318076b762c0ae4bd2022e93 100755 (executable)
@@ -18,7 +18,7 @@ setup_test
 
 expected=$MH_TEST_DIR/$$.expected
 actual=$MH_TEST_DIR/$$.actual
-localmbox=`$MH_LIB_DIR/ap -format "%(localmbox)" 0`
+localmbox=`$MH_LIBEXEC_DIR/ap -format "%(localmbox)" 0`
 #### Use this script itself for the test file.
 testfiledir="$srcdir/test/post"
 testfile=`basename $0`
@@ -47,11 +47,11 @@ test_sendfiles ()
 
   if [ "$argstyle" = 'new' ]; then
     (cd "$MH_TEST_DIR"  &&
-     sendfiles "$@" -to recipient@example.com -subject "sendfiles test" \
-       "$testfile" >/dev/null 2>&1)
+     run_prog sendfiles "$@" -to recipient@example.com \
+       -subject "sendfiles test" "$testfile" >/dev/null 2>&1)
   elif [ "$argstyle" = 'old' ]; then
     (cd "$MH_TEST_DIR"  &&
-     sendfiles "$@" recipient@example.com "sendfiles test" \
+     run_prog sendfiles "$@" recipient@example.com "sendfiles test" \
        "$testfile" >/dev/null 2>&1)
   fi
 
@@ -60,7 +60,8 @@ test_sendfiles ()
   inc -silent -file "$mbox"
   rm -f "$mbox" "$mbox.map"
 
-  mhlist -verbose last | sed -e 's/ *$//' >"$actual"
+  mhlist -verbose last | sed -e 's/ *$//' -e 's/\(octet-stream\).*$/\1/' \
+    >"$actual"
   (cd $MH_TEST_DIR/tmp  &&
    contents=`mhstore -noauto last 2>&1 | \
              sed -e 's/storing message.*as file //'`  &&
@@ -88,7 +89,8 @@ Usage: sendfiles [switches] -to recipient -subject subject file1 [file2 ...]
   Can use PERSON environment variable instead of -from switch.
 EOF
 
-sendfiles -help >"$actual" 2>&1
+#### Skip nmh intro text.
+run_prog sendfiles -help | sed '/^$/,$d' >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
@@ -140,7 +142,7 @@ Usage: sendfiles [switches] -to recipient \
 # check with no compression
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF
@@ -150,7 +152,7 @@ test_sendfiles cat new -compress none
 # check with no compression, -none
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF
@@ -160,7 +162,7 @@ test_sendfiles cat new -none
 # check old argument style (without -to and -subject)
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF
@@ -170,7 +172,7 @@ test_sendfiles cat old -compress none
 # check -from
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF
@@ -180,7 +182,7 @@ test_sendfiles cat new -compress none -from 'Sender <sender@example.com>'
 # check PERSON environment variable
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF
@@ -190,7 +192,7 @@ PERSON='Sender <sender@example.com>' test_sendfiles cat new -compress none
 # check -delay, though for a small file it doesn't do anything
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF
@@ -200,7 +202,7 @@ test_sendfiles cat new -compress none -delay 5
 # check old style -delay, though for a small file it doesn't do anything
 cat >"$expected" <<EOF
  msg part  type/subtype              size description
-  11       application/octet-stream   10K
+  11       application/octet-stream
             type="tar"
             (extract with cat | tar xvpf -)
 EOF