X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6e04c69fadd2c8534aa28ca7d115e7bbedbf1608..5c8b15d4703e145128f51494ffc496dafd5fe718:/test/post/test-sendfiles diff --git a/test/post/test-sendfiles b/test/post/test-sendfiles index 750c7608..84f54bfe 100755 --- a/test/post/test-sendfiles +++ b/test/post/test-sendfiles @@ -17,20 +17,14 @@ fi setup_test expected=$MH_TEST_DIR/$$.expected -expected_err=$MH_TEST_DIR/$$.expected_err actual=$MH_TEST_DIR/$$.actual -actual_err=$MH_TEST_DIR/$$.actual_err -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` -(cd "$MH_TEST_DIR" && -mkdir -p tmp && -cat >"$expected_err" </dev/null 2>"$actual_err") + 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" \ - "$testfile" >/dev/null 2>"$actual_err") + run_prog sendfiles "$@" recipient@example.com "sendfiles test" \ + "$testfile" >/dev/null 2>&1) fi - check "$expected_err" "$actual_err" 'keep first' - # fakesendmail drops the message and any cc's into this mbox. mbox="$MH_TEST_DIR"/Mail/fakesendmail.mbox inc -silent -file "$mbox" - rm -f "$mbox" "$mbox.map" + rm -f "$mbox" - 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 +81,7 @@ Usage: sendfiles [switches] -to recipient -subject subject file1 [file2 ...] or sendfiles [switches] recipient subject file1 [file2 ...] switches are: - -compress [bzip2 | compress | gzip | lzma | none | zip] + -compress [bzip2 | compress | gzip | lzma | none] -from -[delay] (expressed in seconds) -version @@ -96,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 @@ -112,7 +106,7 @@ run_test 'sendfiles -nonexistent' "Usage: sendfiles [switches] -to recipient \ or sendfiles [switches] recipient subject file1 [file2 ...] switches are: - -compress [bzip2 | compress | gzip | lzma | none | zip] + -compress [bzip2 | compress | gzip | lzma | none] -from -[delay] (expressed in seconds) -version @@ -127,7 +121,7 @@ Usage: sendfiles [switches] -to recipient \ or sendfiles [switches] recipient subject file1 [file2 ...] switches are: - -compress [bzip2 | compress | gzip | lzma | none | zip] + -compress [bzip2 | compress | gzip | lzma | none] -from -[delay] (expressed in seconds) -version @@ -139,16 +133,16 @@ Usage: sendfiles [switches] -to recipient \ # because it will vary with compression method and compressed file # size. [ "`findprog bzip2`" ] && test_sendfiles 'bzip2 -cd' new -compress bzip2 -[ "`findprog compress`" ] && test_sendfiles uncompress new -compress compress +[ "`findprog compress`" ] && test_sendfiles 'uncompress -c' new \ + -compress compress [ "`findprog gzip`" ] && test_sendfiles 'gzip -cd' new -compress gzip [ "`findprog gzip`" ] && test_sendfiles 'gzip -cd' new -gzip [ "`findprog lzma`" ] && test_sendfiles 'lzma -cd' new -compress lzma -[ "`findprog zip`" ] && test_sendfiles 'unzip -p' new -compress zip # check with no compression cat >"$expected" <"$expected" <"$expected" <"$expected" <' # check PERSON environment variable cat >"$expected" <"$expected" <"$expected" <