X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/0f0af4e32a4d734209c16282b63f7cb1094e2699..39bfc0b25d39979d1ec47b14e69a4f17ea3493ab:/test/rcv/test-rcvstore diff --git a/test/rcv/test-rcvstore b/test/rcv/test-rcvstore index 82d270d7..a49a3ccd 100755 --- a/test/rcv/test-rcvstore +++ b/test/rcv/test-rcvstore @@ -17,7 +17,7 @@ fi setup_test # Use proper program, likely not the first one on PATH. -rcvstore="${MH_LIB_DIR}/rcvstore" +rcvstore="${MH_LIBEXEC_DIR}/rcvstore" expected=$MH_TEST_DIR/$$.expected expected_err=$MH_TEST_DIR/$$.expected_err @@ -38,8 +38,9 @@ Usage: rcvstore [+folder] [switches] -help EOF -$rcvstore -help >$actual 2>&1 -check $expected $actual +#### Skip nmh intro text. +run_prog "$rcvstore" -help | sed '/^$/,$d' >"$actual" 2>&1 +check "$expected" "$actual" # check -version case `$rcvstore -v` in @@ -56,23 +57,23 @@ cat >$expected <$actual 2>&1 +run_prog $rcvstore $actual 2>&1 check $expected $actual # check with no switches cat >$expected <$actual 2>&1 +run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check + of existing folder -$rcvstore +inbox <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore +inbox <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check + of new folder -$rcvstore +newfolder <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore +newfolder <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/newfolder/1" \ 'keep first' @@ -84,14 +85,14 @@ rcvstore: folder ${MH_TEST_DIR}/Mail/newfolder doesn't exist EOF set +e -$rcvstore +newfolder -nocreate <${MH_TEST_DIR}/Mail/inbox/1 >$actual \ +run_prog $rcvstore +newfolder -nocreate <${MH_TEST_DIR}/Mail/inbox/1 >$actual \ 2>$actual_err set -e check $expected $actual 'keep first' check $expected_err $actual_err # check -create -$rcvstore +newfolder -nocreate -create <${MH_TEST_DIR}/Mail/inbox/1 \ +run_prog $rcvstore +newfolder -nocreate -create <${MH_TEST_DIR}/Mail/inbox/1 \ >$actual 2>&1 check $expected $actual 'keep first' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/newfolder/1" \ @@ -100,7 +101,7 @@ rmdir "${MH_TEST_DIR}/Mail/newfolder" # check addition to unseen sequence printf 'Unseen-Sequence: unseen\n' >> $MH -$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence unseen -list' 'unseen: 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' @@ -109,59 +110,62 @@ touch "${MH_TEST_DIR}/Mail/inbox/11" rmm 11 # check -nounseen -$rcvstore -nounseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -nounseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence unseen -list' 'unseen: ' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check -unseen -$rcvstore -nounseen -unseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -nounseen -unseen <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence unseen -list' 'unseen: 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check -sequence -$rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence newseq -list' 'newseq: 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check that default is -nozero mark -sequence newseq all -$rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -sequence newseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence newseq -list' 'newseq: 1-11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check -zero mark -sequence newseq all -$rcvstore -sequence newseq -zero <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -sequence newseq -zero \ + <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence newseq -list' 'newseq: 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check -nozero mark -sequence newseq all -$rcvstore -seq newseq -zero -nozero <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -seq newseq -zero -nozero \ + <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence newseq -list' 'newseq: 1-11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check that default is -public -$rcvstore -sequence pubseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -sequence pubseq <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence pubseq -list' 'pubseq: 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check -nopublic -$rcvstore -sequence privseq -nopublic <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore -sequence privseq -nopublic \ + <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence privseq -nopublic -list' 'privseq (private): 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check -public -$rcvstore -sequence pubseq -nopublic -public <${MH_TEST_DIR}/Mail/inbox/1 \ - >$actual 2>&1 +run_prog $rcvstore -sequence pubseq -nopublic -public \ + <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test 'mark -sequence pubseq -public -list' 'pubseq: 11' check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' @@ -186,7 +190,7 @@ fi # check default Msg-Protect msgprot=`mhparam msgprot` -$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual 'keep first' run_test "find ${MH_TEST_DIR}/Mail/inbox/11 -perm $msgprot" \ "${MH_TEST_DIR}/Mail/inbox/11" @@ -195,7 +199,7 @@ check "${MH_TEST_DIR}/Mail/inbox/1" "${MH_TEST_DIR}/Mail/inbox/11" 'keep first' # check Msg-Protect profile entry msgprot=640 printf 'Msg-Protect: %s\n' "$msgprot" >>$MH -$rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 +run_prog $rcvstore <${MH_TEST_DIR}/Mail/inbox/1 >$actual 2>&1 check $expected $actual run_test "find ${MH_TEST_DIR}/Mail/inbox/11 -perm $msgprot" \ "${MH_TEST_DIR}/Mail/inbox/11"