]> diplodocus.org Git - nmh/blobdiff - test/refile/test-refile
Reworked LFLAGS hack for flex 2.5.35 and 2.5.36 to work on
[nmh] / test / refile / test-refile
index 128ebd4478246ce6e6a15c4d7188f6ee84a85a3a..645f4f1c7872d5cc158e0bdf9a962ef9c87c0f86 100755 (executable)
@@ -21,14 +21,14 @@ actual=$MH_TEST_DIR/$$.actual
 
 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
-folder +inbox 4 >/dev/null
+run_prog folder +inbox 4 >/dev/null
 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
-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.
@@ -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"
-folder -f +another >/dev/null
+run_prog folder -f +another >/dev/null
 
 # check -src
 run_test 'refile 9 -src +inbox +other' ''
@@ -115,17 +115,25 @@ other+ has  1 message   (1- 1).
 
 TOTAL = 11 messages in 2 folders.'
 
-# check -link
-run_test 'refile 7 -src +inbox +other -link' ''
-run_test 'folders -noheader' \
-'inbox+ has 10 messages  (1-10); cur=7.
+check_for_hard_links
+if [ $hard_links_supported -eq 1 ]; then
+  # check -link
+  run_test 'refile 7 -src +inbox +other -link' ''
+  run_test 'folders -noheader' \
+  'inbox+ has 10 messages  (1-10); cur=7.
 other  has  2 messages  (1- 2).
 
 TOTAL = 12 messages in 2 folders.'
-# inbox/7 and other/2 are linked.  Modify one and verify
-# that the other changes as well.
-echo '' >>$MH_TEST_DIR/Mail/other/2
-run_test "cmp $MH_TEST_DIR/Mail/inbox/7 $MH_TEST_DIR/Mail/other/2" ''
+  # inbox/7 and other/2 are linked.  Modify one and verify
+  # that the other changes as well.
+  echo '' >>$MH_TEST_DIR/Mail/other/2
+  run_test "cmp $MH_TEST_DIR/Mail/inbox/7 $MH_TEST_DIR/Mail/other/2" ''
+else
+  # Hard links are not supported.  Skip the -link test but emulate
+  # what it would have done using a copy instead of a link.
+  cp -p Mail/inbox/7 Mail/other/2
+  folder -f +inbox 7 >/dev/null
+fi
 
 # check -nolink
 run_test 'refile 7 +other -link -nolink' ''
@@ -176,7 +184,9 @@ 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/,2; then
+  :
+else
   echo "$0: refile -nounlink failed" 1>&2
   failed=`expr ${failed:-0} + 1`
 fi
@@ -208,5 +218,13 @@ other      has 9 messages  (1-15).
 
 TOTAL = 13 messages in 3 folders.'
 
+# test -retainsequences
+mark first -seq seq1
+mark last -seq seq2
+refile first last -retainsequences +other
+run_test 'mark +other -list -sequence seq1 -sequence seq2' \
+         "seq1: 16
+seq2: 17"
+
 
 exit $failed