File: test-empty-seq

package info (click to toggle)
mmh 0.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 4,976 kB
  • sloc: ansic: 26,132; sh: 6,871; makefile: 680; awk: 74
file content (44 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

# TODO: Move to a common file tests can source; need more framework...
failed=0
check() {
    diff -u $expected $actual
    if [ $? -ne 0 ]; then
        failed=$((failed + 1))
    fi
}

folders=$MH_TEST_DIR/Mail/.folders

expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/$$.actual

# make second folder
cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo1
cp -r $MH_TEST_DIR/Mail/inbox $MH_TEST_DIR/Mail/foo2
# but only list inbox and foo2 in .folders, and sorted differently
cat > $folders <<EOF
inbox
foo2
EOF

# Add a sequence, which has no messages in it
echo empty: >>"$MH_TEST_DIR/Mail/foo2/.mh_sequences"

# test with the empty sequence
cat > $expected <<EOF
 total      0.
EOF
new empty > $actual 2>&1
check
new -folders $folders empty > $actual 2>&1
check

# test fnext/fprev with the empty sequence
> $expected
fnext empty > $actual 2>&1
check
fprev empty > $actual 2>&1
check