setup_test
+check_exit '-eq 1' refile -
+
expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/$$.actual
TOTAL = 11 messages in 2 folders.'
check_for_hard_links
-if [ $hard_links_supported -eq 1 ]; then
+if [ $xdir_links_supported -eq 1 ]; then
# check -link
run_test 'refile 7 -src +inbox +other -link' ''
run_test 'folders -noheader' \
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' \
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
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
mark first -seq seq1
mark last -seq seq2
refile first last -retainsequences +other
+#### The following command changes the current folder to +other.
run_test 'mark +other -list -sequence seq1 -sequence seq2' \
"seq1: 16
seq2: 17"
+# test -retainsequences when refiling to same folder (+other)
+# cur is set to the original message number of the last message refiled.
+mark first -seq seq1 -zero
+mark first=2 -seq seq2 -zero
+refile first:2 -retainsequences +other
+run_test 'mark -list' "cur: 2
+seq1: 18
+seq2: 19"
exit $failed