Add test for empty sequence patch by c_14
[mmh] / test / tests / new / test-empty-seq
1 #!/bin/sh
2
3 # TODO: Move to a common file tests can source; need more framework...
4 failed=0
5 check() {
6     diff -u $expected $actual
7     if [ $? -ne 0 ]; then
8         failed=$((failed + 1))
9     fi
10 }
11
12 folders=$MH_TEST_DIR/Mail/.folders
13
14 expected=$MH_TEST_DIR/$$.expected
15 actual=$MH_TEST_DIR/$$.actual
16
17 # make second folder
18 cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo1
19 cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo2
20 # but only list inbox and foo2 in .folders, and sorted differently
21 cat > $folders <<EOF
22 inbox
23 foo2
24 EOF
25
26 # Add a sequence, which has no messages in it
27 echo empty: >>"$MH_TEST_DIR/Mail/foo2/.mh_sequences"
28
29 # test with the empty sequence
30 cat > $expected <<EOF
31  total      0.
32 EOF
33 new empty > $actual 2>&1
34 check
35 new -folders $folders empty > $actual 2>&1
36 check
37
38 # test fnext/fprev with the empty sequence
39 > $expected
40 fnext empty > $actual 2>&1
41 check
42 fprev empty > $actual 2>&1
43 check
44