2 ######################################################
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname $0`/../..
12 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 . "$MH_OBJ_DIR/test/common.sh"
19 # Test sequence creation.
20 run_test 'mark 1 3 5 7 +inbox -sequence odd' ''
21 run_test 'mark 2 4 6 8 10 +inbox -sequence even' ''
22 run_test 'mark +inbox -seq odd -seq even -list' \
27 run_test 'mark 9 -sequence odd -add -nozero' ''
28 run_test 'mark -seq odd -list' 'odd: 1 3 5 7 9'
31 run_test 'mark 9 -sequence odd -delete' ''
32 run_test 'mark -seq odd -list' 'odd: 1 3 5 7'
34 # Test that -nozero is default
35 run_test 'mark 9 -sequence odd -add' ''
36 run_test 'mark -seq odd -list' 'odd: 1 3 5 7 9'
39 run_test 'mark 10 -s even -add -zero' ''
40 run_test 'mark -s even -list' 'even: 10'
42 # Test add prior to last message;
43 run_test 'mark 8 -s even -add' ''
44 run_test 'mark -s even -list' 'even: 8 10'
47 run_test 'mark -s odd -list' 'odd: 1 3 5 7 9'
49 # Try to mark message that doesn't exist.
50 run_test 'mark 12' "mark: message 12 doesn't exist"
52 # Try to mark nonexistent folder.
53 run_test 'mark +nonexistent' \
54 "mark: unable to change directory to `mhpath +`/nonexistent: \
55 No such file or directory"
57 # Test private sequence creation.
58 # Set current message for following tests.
59 folder +inbox 1 > /dev/null
60 run_test 'mark 1 -sequence privateseq -add -nopublic' ''
61 run_test 'mark -list' 'cur: 1
64 privateseq (private): 1'
66 # Test add to private sequence.
67 run_test 'mark 2 -sequence privateseq -add -nopublic' ''
68 run_test 'mark -list' 'cur: 1
71 privateseq (private): 1-2'
73 # Test private sequence list.
74 run_test 'mark -sequence privateseq -list' 'privateseq (private): 1-2'
76 # Test private sequence list with -public, which is apparently ignored.
77 run_test 'mark -sequence privateseq -list -public' 'privateseq (private): 1-2'
79 # Test mark on empty folder.
80 folder -create +other > /dev/null
81 run_test 'mark +other -sequence unseen all' 'mark: no messages in other'