From: Ralph Corderoy Date: Sun, 26 Nov 2017 12:09:22 +0000 (+0000) Subject: Fix tests that assume the backup prefix is a comma. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/47b86722957cca6057bf5fcd07c9d1f01b4516f8?hp=d9c88cd101a63778a85dfd55a01a3af0db2465c9 Fix tests that assume the backup prefix is a comma. Steven Winikoff reported to nmh-workers that some tests failed in 1.7 configured with --with-hash-backup because they assume the backup prefix is comma rather than hash. Alter those tests to use `mhparam sbackup', as other tests already do. PATH is already set to use the mhparam being tested. test-mhfixmsg used find(1) to check for leftover files that globbed `mhfix*' or `,mhfix*'. Changed to just `*mhfix*' as I think any file containing that would be unwanted, and it will also spot mhfixmsg hard-coding the comma prefix. --- diff --git a/test/mhbuild/test-forw b/test/mhbuild/test-forw index bdbd8c00..2789ee2f 100755 --- a/test/mhbuild/test-forw +++ b/test/mhbuild/test-forw @@ -29,7 +29,7 @@ EOF } draft="$MH_TEST_DIR/$$.draft" -draftorig="$MH_TEST_DIR/,$$.draft.orig" +draftorig="$MH_TEST_DIR/`mhparam sbackup`$$.draft.orig" expected="$MH_TEST_DIR/$$.expected" actual="$MH_TEST_DIR/$$.actual" diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index f741d9c6..c2070c51 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -179,6 +179,7 @@ run_test 'mhfixmsg last -outfile '"$actual"' -verbose' \ QUOTED-PRINTABLE with 8 bit" check "$expected" "$actual" 'keep first' +sbackup="`mhparam sbackup`" # check with no options: checks backup start_test "with no options: checks backup" @@ -187,7 +188,7 @@ folder last >/dev/null run_test 'mhfixmsg' '' check "$expected" "$MH_TEST_DIR"/Mail/inbox/11 'keep first' cp "$MH_TEST_DIR"/Mail/inbox/11.original "$MH_TEST_DIR"/Mail/inbox/11 -check "$MH_TEST_DIR"/Mail/inbox/,11 "$MH_TEST_DIR"/Mail/inbox/11.original +check "$MH_TEST_DIR/Mail/inbox/${sbackup}11" "$MH_TEST_DIR"/Mail/inbox/11.original # check backup with -file @@ -196,7 +197,7 @@ cp "$MH_TEST_DIR"/Mail/inbox/11 "$MH_TEST_DIR"/Mail/inbox/11.original folder last >/dev/null run_test 'mhfixmsg -file '"$MH_TEST_DIR"/Mail/inbox/11 '' check "$MH_TEST_DIR"/Mail/inbox/11 "$expected" 'keep first' -check "$MH_TEST_DIR"/Mail/inbox/,11 "$MH_TEST_DIR"/Mail/inbox/11.original +check "$MH_TEST_DIR/Mail/inbox/${sbackup}11" "$MH_TEST_DIR"/Mail/inbox/11.original # check -file with directory @@ -1375,7 +1376,7 @@ EOF run_test 'mhfixmsg 21 -normmproc' check "${MH_TEST_DIR}/Mail/inbox/22" \ - "${MH_TEST_DIR}/Mail/inbox/,21" 'keep first' + "${MH_TEST_DIR}/Mail/inbox/${sbackup}21" 'keep first' fi @@ -1790,7 +1791,7 @@ check "$expected" "$actual" # make sure there are no tmp files left over -find "$MH_TEST_DIR/Mail" \( -name 'mhfix*' -o -name ',mhfix*' \) -print \ +find "$MH_TEST_DIR/Mail" -name '*mhfix*' -print \ >"$actual" cat >"$expected" <"${testname}.err" diff --git a/test/refile/test-refile b/test/refile/test-refile index 58fd373f..6be4874c 100755 --- a/test/refile/test-refile +++ b/test/refile/test-refile @@ -167,6 +167,8 @@ TOTAL = 12 messages in 2 folders.' run_test 'scan +other last -format %(msg):%(decode{subject})' \ '11:Testing message 9' +sbackup="`mhparam sbackup`" + # check -unlink run_test 'refile 3 -src +inbox +other -unlink' '' run_test 'folders -noheader' \ @@ -174,7 +176,7 @@ run_test 'folders -noheader' \ other has 6 messages (1-12). TOTAL = 12 messages in 2 folders.' -if test -f $MH_TEST_DIR/Mail/inbox/,3; then +if test -f "$MH_TEST_DIR/Mail/inbox/${sbackup}3"; then echo "$0: refile -unlink failed" 1>&2 failed=`expr ${failed:-0} + 1` fi @@ -186,7 +188,7 @@ run_test 'folders -noheader' \ other has 7 messages (1-13). TOTAL = 12 messages in 2 folders.' -if test -f $MH_TEST_DIR/Mail/inbox/,2; then +if test -f "$MH_TEST_DIR/Mail/inbox/${sbackup}2"; then : else echo "$0: refile -nounlink failed" 1>&2