]>
diplodocus.org Git - nmh/blob - test/new/test-basic
2 ######################################################
4 # Test many basic nmh capabilities.
6 ######################################################
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir
=`dirname $0`/..
/..
10 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
13 .
"$MH_OBJ_DIR/test/common.sh"
16 # TODO: Move to a common file tests can source; need more framework...
19 diff -u $expected $actual
21 failed
=$
((failed
+ 1))
25 folders
=$MH_TEST_DIR/Mail
/.folders
27 expected
=$MH_TEST_DIR/$$.expected
28 actual
=$MH_TEST_DIR/$$.actual
31 cp -r $MH_TEST_DIR/Mail
/inbox
$MH_TEST_DIR/Mail
/foo1
32 cp -r $MH_TEST_DIR/Mail
/inbox
$MH_TEST_DIR/Mail
/foo2
33 # but only list inbox and foo2 in .folders, and sorted differently
39 # test with no sequence
41 new: must specify sequences or set Unseen-Sequence
46 # test with no desired messages
50 new aseq
> $actual 2>&1
52 new
-folders $folders aseq
> $actual 2>&1
55 # test fnext/fprev with no desired messages
56 cat /dev
/null
> $expected
57 fnext aseq
> $actual 2>&1
59 fprev aseq
> $actual 2>&1
62 # add 1 desired message in each folder
63 echo 'aseq: 1' > $MH_TEST_DIR/Mail
/inbox
/.mh_sequences
64 echo 'aseq: 1' > $MH_TEST_DIR/Mail
/foo
1/.mh_sequences
65 echo 'aseq: 1' > $MH_TEST_DIR/Mail
/foo
2/.mh_sequences
67 # test with all folders
74 new aseq
> $actual 2>&1
83 new
-folders $folders aseq
> $actual 2>&1
86 # add 2 desired messages to another sequence in each folder
87 echo 'bseq: 3-4' >> $MH_TEST_DIR/Mail
/inbox
/.mh_sequences
88 echo 'bseq: 3-4' >> $MH_TEST_DIR/Mail
/foo
1/.mh_sequences
89 echo 'bseq: 3-4' >> $MH_TEST_DIR/Mail
/foo
2/.mh_sequences
91 # test listing aseq and bseq
98 new aseq bseq
> $actual 2>&1
101 # set aseq bseq as unseen
102 echo 'Unseen-Sequence: aseq bseq' >> $MH
107 cat > $expected <<EOF
109 3 aseq bseq messages in foo1
110 1 09/29 Test1 Testing message 1<<This is message number 1 >>
111 3 09/29 Test3 Testing message 3<<This is message number 3 >>
112 4 09/29 Test4 Testing message 4<<This is message number 4 >>
114 3 aseq bseq messages in foo2
115 1 09/29 Test1 Testing message 1<<This is message number 1 >>
116 3 09/29 Test3 Testing message 3<<This is message number 3 >>
117 4 09/29 Test4 Testing message 4<<This is message number 4 >>
119 3 aseq bseq messages in inbox (*: current folder)
120 1 09/29 Test1 Testing message 1<<This is message number 1 >>
121 3 09/29 Test3 Testing message 3<<This is message number 3 >>
122 4 09/29 Test4 Testing message 4<<This is message number 4 >>
124 unseen
> $actual 2>&1
127 # test fnext with the current folder not in the list
128 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail
/context
129 echo 'inbox 1 3-4' > $expected
130 fnext
-folders $folders > $actual 2>&1
133 # test fprev with the current folder not in the list
134 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail
/context
135 echo 'inbox 1 3-4' > $expected
136 fprev
-folders $folders > $actual 2>&1
139 # test fnext with current folder in the middle of the list
140 echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail
/context
141 echo 'inbox 1 3-4' > $expected
145 # test fprev with current folder in the middle of the list
146 echo 'Current-Folder: foo2' > $MH_TEST_DIR/Mail
/context
147 echo 'foo1 1 3-4' > $expected
151 # test fprev with current folder at the beginning of the list
152 echo 'Current-Folder: foo1' > $MH_TEST_DIR/Mail
/context
153 echo 'inbox 1 3-4' > $expected
157 # test fnext with current folder at the end of the list
158 echo 'Current-Folder: inbox' > $MH_TEST_DIR/Mail
/context
159 echo 'foo1 1 3-4' > $expected
163 # test fnext with no current folder
164 rm $MH_TEST_DIR/Mail
/context
165 echo 'foo1 1 3-4' > $expected
169 # test fnext with only one folder in the list
173 echo 'inbox 1 3-4' > $expected
174 fnext
-folders $folders > $actual 2>&1