]> diplodocus.org Git - nmh/blobdiff - test/refile/test-refile
Fix netrc's token()'s bug if backslash escapes EOF.
[nmh] / test / refile / test-refile
index 62f086df15a064dd4edbe5ab761a9213b9378e8d..64df564fc4c7dcec43448bb6ab029e7550b53ae5 100755 (executable)
@@ -21,14 +21,14 @@ actual=$MH_TEST_DIR/$$.actual
 
 cd $MH_TEST_DIR
 
 
 cd $MH_TEST_DIR
 
-folder -create +other -fast >/dev/null
-folder -create +another -fast >/dev/null
+run_prog folder -create +other -fast >/dev/null
+run_prog folder -create +another -fast >/dev/null
 
 # check with no options and no current message
 run_test 'refile' 'refile: no folder specified'
 
 # check with current message
 
 # check with no options and no current message
 run_test 'refile' 'refile: no folder specified'
 
 # check with current message
-folder +inbox 4 >/dev/null
+run_prog folder +inbox 4 >/dev/null
 run_test 'refile +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
 run_test 'refile +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
@@ -38,7 +38,7 @@ other    has  1 message   (1- 1).
 TOTAL = 10 messages in 3 folders.'
 
 # check with specified message
 TOTAL = 10 messages in 3 folders.'
 
 # check with specified message
-folder +inbox 5 >/dev/null
+run_prog folder +inbox 5 >/dev/null
 run_test 'refile 5 +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
 run_test 'refile 5 +other' ''
 run_test 'folders -noheader' \
 'another  has no messages.
@@ -67,7 +67,7 @@ TOTAL = 11 messages in 3 folders.'
 
 # check message number greater than highest
 run_test 'refile 11 +other' "refile: message 11 doesn't exist"
 
 # check message number greater than highest
 run_test 'refile 11 +other' "refile: message 11 doesn't exist"
-folder -f +another >/dev/null
+run_prog folder -f +another >/dev/null
 
 # check -src
 run_test 'refile 9 -src +inbox +other' ''
 
 # check -src
 run_test 'refile 9 -src +inbox +other' ''
@@ -116,7 +116,7 @@ other+ has  1 message   (1- 1).
 TOTAL = 11 messages in 2 folders.'
 
 check_for_hard_links
 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' \
   # check -link
   run_test 'refile 7 -src +inbox +other -link' ''
   run_test 'folders -noheader' \
@@ -218,5 +218,22 @@ other      has 9 messages  (1-15).
 
 TOTAL = 13 messages in 3 folders.'
 
 
 TOTAL = 13 messages in 3 folders.'
 
+# test -retainsequences
+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
 
 exit $failed