]> diplodocus.org Git - nmh/blobdiff - test/inc/test-msgchk
annosbr.c: free(3) takes void pointer; don't cast non-const pointer.
[nmh] / test / inc / test-msgchk
index c6850d99026612472b748b79498bca0974083755..4ac4554e2004147b69a8b1d447104558689399d4 100755 (executable)
@@ -18,6 +18,8 @@ fi
 
 setup_test
 
+check_exit '-eq 1' msgchk -
+
 expected=$MH_TEST_DIR/$$.expected
 expected_err=$MH_TEST_DIR/$$.expected_err
 actual=$MH_TEST_DIR/$$.actual
@@ -39,7 +41,7 @@ Usage: msgchk [switches] [users ...]
   -help
 EOF
 
-msgchk -help | head -9 >"$actual" 2>&1
+run_prog msgchk -help | head -9 >"$actual" 2>&1
 check "$expected" "$actual"
 
 # check -version
@@ -57,7 +59,7 @@ run_test 'msgchk' "You don't have any mail waiting"
 
 # Use maildrop specified in mts.conf, i.e.,
 # ${MH_TEST_DIR}/Mail/maildrop, which should not yet exist.
-"${MH_LIB_DIR}"/rcvpack <"${MH_TEST_DIR}"/Mail/inbox/1 \
+"${MH_LIBEXEC_DIR}"/rcvpack <"${MH_TEST_DIR}"/Mail/inbox/1 \
   "${MH_TEST_DIR}"/Mail/maildrop
 
 # check with no arguments and mail waiting
@@ -65,7 +67,7 @@ cat >"$expected" <<EOF
 You have new mail waiting; last read on
 EOF
 
-msgchk | sed -e 's/last read on.*/last read on/' >"$actual"
+run_prog msgchk | sed -e 's/last read on.*/last read on/' >"$actual"
 check "$expected" "$actual"
 
 # check -date
@@ -73,7 +75,8 @@ cat >"$expected" <<EOF
 You have new mail waiting; last read on
 EOF
 
-msgchk -nodate -date | sed -e 's/last read on.*/last read on/' >"$actual"
+run_prog msgchk -nodate -date | sed -e 's/last read on.*/last read on/' \
+  >"$actual"
 check "$expected" "$actual"
 
 # check -nodate
@@ -97,7 +100,7 @@ run_test 'msgchk -nonotify nomail -nodate' 'You have new mail waiting'
 # check -nonotify all, when there is mail
 run_test 'msgchk -nonotify nomail -nonotify all -nodate' ''
 
-inc -silent
+run_prog inc -silent
 
 # check -notify mail, when there is no mail
 run_test 'msgchk -notify mail -nodate' "You don't have any mail waiting"