]> diplodocus.org Git - nmh/commitdiff
Fix tests that assume the backup prefix is a comma.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 26 Nov 2017 12:09:22 +0000 (12:09 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 26 Nov 2017 12:18:22 +0000 (12:18 +0000)
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.

test/mhbuild/test-forw
test/mhfixmsg/test-mhfixmsg
test/post/test-rfc6531
test/refile/test-refile

index bdbd8c005a8f65ee256c41920d3fa2c61b0ce99d..2789ee2f4abac470588e906a3d733e8d3c635144 100755 (executable)
@@ -29,7 +29,7 @@ EOF
 }
 
 draft="$MH_TEST_DIR/$$.draft"
 }
 
 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"
 
 expected="$MH_TEST_DIR/$$.expected"
 actual="$MH_TEST_DIR/$$.actual"
 
index f741d9c6823f2a276f145e9087340b3570fb87ea..c2070c51ecec86d611a325d493f8bb77f03b2604 100755 (executable)
@@ -179,6 +179,7 @@ run_test 'mhfixmsg last -outfile '"$actual"' -verbose' \
 QUOTED-PRINTABLE with 8 bit"
 check "$expected" "$actual" 'keep first'
 
 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"
 
 # 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
 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
 
 
 # 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'
 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
 
 
 # check -file with directory
@@ -1375,7 +1376,7 @@ EOF
 
   run_test 'mhfixmsg 21 -normmproc'
   check "${MH_TEST_DIR}/Mail/inbox/22" \
 
   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
 
 
 fi
 
 
@@ -1790,7 +1791,7 @@ check "$expected" "$actual"
 
 
 # make sure there are no tmp files left over
 
 
 # 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" <<EOF
 EOF
   >"$actual"
 cat >"$expected" <<EOF
 EOF
index 817388dab9ea6f56c2b22267b83219718add954a..beb393cc424329601c62ea07c4c357f36e04a49e 100755 (executable)
@@ -115,7 +115,7 @@ Rebuild message with 7-bit headers, WITHOUT -headerencoding utf-8.
 post: problem initializing server; [BHST] ready; I'll buy that for a dollar!
 send: message not delivered to anyone
 EOF
 post: problem initializing server; [BHST] ready; I'll buy that for a dollar!
 send: message not delivered to anyone
 EOF
-mv -f "${MH_TEST_DIR}/Mail/,draft" "${MH_TEST_DIR}/Mail/draft"
+mv -f "${MH_TEST_DIR}/Mail/`mhparam sbackup`draft" "${MH_TEST_DIR}/Mail/draft"
 
 set +e
 test_post "${testname}.actual" "${testname}.expected" 2>"${testname}.err"
 
 set +e
 test_post "${testname}.actual" "${testname}.expected" 2>"${testname}.err"
index 58fd373f414b3771c46adae53f9f3c1292fec6bc..6be4874ca93382d24cb0fab42cd8d4cf65670cdf 100755 (executable)
@@ -167,6 +167,8 @@ TOTAL = 12 messages in 2 folders.'
 run_test 'scan +other last -format %(msg):%(decode{subject})' \
          '11:Testing message 9'
 
 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' \
 # 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.'
 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
   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.'
 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
   :
 else
   echo "$0: refile -nounlink failed" 1>&2