]> diplodocus.org Git - nmh/blob - test/forw/test-forw-digest
Changed domains in man page and test examples to use example.com
[nmh] / test / forw / test-forw-digest
1 #!/bin/sh
2 #
3 # Tests to see if "forw -digest" works correctly.
4 #
5
6 if test -z "${MH_OBJ_DIR}"; then
7 srcdir=`dirname "$0"`/../..
8 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
9 fi
10
11 . "$MH_OBJ_DIR/test/common.sh"
12
13 setup_test
14
15 expected="${MH_TEST_DIR}/$$.expected"
16 actual="${MH_TEST_DIR}/Mail/draft"
17 from="Mr Test User <test@example.com>"
18 to1="User One <userone@example.com>"
19 to2="User Two <usertwo@example.com>"
20 cc1="CC User One <ccuserone@example.com>"
21 cc2="CC User Two <ccusertwo@example.com>"
22 cc3="CC User Three <ccuserthree@example.com>"
23 cc4="CC User Four <ccuserfour@example.com>"
24 fcc1="+nosuchmailbox"
25 fcc2="+nosuchmailbox2"
26
27 digestdate=$(date "+%A, %d %b %G")
28
29 cat > "$expected" <<EOF
30 From: ${from}
31 To: ${to1},
32 ${to2}
33 cc: ${cc1},
34 ${cc2},
35 ${cc3},
36 ${cc4}
37 Fcc: ${fcc1}, ${fcc2}
38 Subject: digest-test Digest V2 #3
39 Reply-To: digest-test
40 --------
41 digest-test Digest $digestdate
42 Volume 2 : Issue 3
43
44 Today's Topics:
45
46 ------------------------------------------------------------
47
48 EOF
49
50 i=1
51 while [ "$i" -le 6 ]
52 do
53 filename=$(mhpath +inbox $i)
54 cat $filename >> "$expected"
55 cat >> "$expected" <<EOF
56
57 ------------------------------
58
59 EOF
60 i=$(expr $i + 1)
61 done
62
63 cat >> "$expected" <<EOF
64 End of digest-test Digest [Volume 2 Issue 3]
65 ********************************************
66 EOF
67
68 forw -editor true -from "${from}" -to "${to1}" -to "${to2}" \
69 -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
70 -fcc "${fcc2}" -width 60 -issue 3 -volume 2 -nowhatnowproc \
71 -digest digest-test +inbox 1-6 || exit 1
72
73 check "${expected}" "${actual}"
74
75 #
76 # Once more, but taking some of the defaults
77 #
78
79 cat > "$expected" <<EOF
80 From: ${from}
81 To: digest-test Distribution: dist-digest-test;
82 Subject: This is a test
83 Reply-To: digest-test
84 --------
85 digest-test Digest ${digestdate}
86 Volume 2 : Issue 4
87
88 Today's Topics:
89
90 ------------------------------------------------------------
91
92 EOF
93
94 i=7
95 while [ "$i" -le 8 ]
96 do
97 filename=$(mhpath +inbox $i)
98 cat $filename >> "$expected"
99 cat >> "$expected" <<EOF
100
101 ------------------------------
102
103 EOF
104 i=$(expr $i + 1)
105 done
106
107 cat >> "$expected" <<EOF
108 End of digest-test Digest [Volume 2 Issue 4]
109 ********************************************
110 EOF
111
112 forw -editor true -from "${from}" -nowhatnowproc -digest digest-test \
113 -subject "This is a test" +inbox 7-8 || exit 1
114
115 check "${expected}" "${actual}"
116
117 exit $failed