]>
diplodocus.org Git - nmh/blob - test/comp/test-comp-format
362019f208e4c30861bfb0d5b8d09c5f28ea90a1
3 # Tests to see if the -from, -to, -cc, -fcc, and -subject switches to
4 # "comp" work correctly.
7 if test -z "${MH_OBJ_DIR}"; then
8 srcdir
=`dirname "$0"`/..
/..
9 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
12 .
"$MH_OBJ_DIR/test/common.sh"
16 check_exit
'-eq 1' comp
- # gcov
17 check_exit
'-eq 1' comp
-xyzzy # gcov
18 check_exit
'-eq 0' comp
-help # gcov
19 check_exit
'-eq 0' comp
-version # gcov
20 check_exit
'-eq 1' comp
-build -noedit -editor # gcov
21 check_exit
'-eq 1' comp
-whatnowproc # gcov
22 check_exit
'-eq 1' comp
-whatnowproc '' - # gcov
23 check_exit
'-eq 1' comp
-use -nouse -form # gcov
24 check_exit
'-eq 1' comp
-file # gcov
25 check_exit
'-eq 1' comp
-file foo
-file # gcov
26 check_exit
'-eq 1' comp
-nodraftfolder -draftfolder # gcov
27 check_exit
'-eq 1' comp
-draftfolder foo
-draftfolder # gcov
28 check_exit
'-eq 1' comp
-draftmessage # gcov
29 check_exit
'-eq 1' comp
-draftmessage foo
-draftmessage # gcov
30 check_exit
'-eq 1' comp
-to # gcov
31 check_exit
'-eq 1' comp
-cc # gcov
32 check_exit
'-eq 1' comp
-from # gcov
33 check_exit
'-eq 1' comp
-fcc # gcov
34 check_exit
'-eq 1' comp
-fcc @
- # gcov
35 check_exit
'-eq 1' comp
-width # gcov
36 check_exit
'-eq 1' comp
-width 0 # gcov
37 check_exit
'-eq 1' comp
-subject # gcov
38 check_exit
'-eq 1' comp
+ @
# gcov
39 check_exit
'-eq 1' comp
42 314 # gcov
40 check_exit
'-eq 1' comp
-form foo
42 # gcov
41 check_exit
'-eq 1' comp
+ # gcov
42 check_exit
'-eq 1' comp
42 # gcov
45 # Create a test template file (we create one here just in case the master
49 form
="${MH_TEST_DIR}/$$.components"
51 %(void{from})%(void(width))%(putaddr From: )
52 %(void{to})%(void(width))%(putaddr To: )
53 %(void{cc})%(void(width))%(putaddr cc: )
59 expected
="${MH_TEST_DIR}/$$.expected"
60 actual
="${MH_TEST_DIR}/Mail/draft"
61 from
="Mr Test User <test@example.com>"
62 to1
="User One <userone@example.com>"
63 to2
="User Two <usertwo@example.com>"
64 cc1
="CC User One <ccuserone@example.com>"
65 cc2
="CC User Two <ccusertwo@example.com>"
66 cc3
="CC User Three <ccuserthree@example.com>"
67 cc4
="CC User Four <ccuserfour@example.com>"
69 fcc2
="+nosuchmailbox2"
70 subject
="Totally bogus subject"
86 comp
-editor true
-form "${form}" -from "${from}" -to "${to1}" -to "${to2}" \
87 -cc "${cc1}" -cc "${cc2}" -cc "${cc3}" -cc "${cc4}" -fcc "${fcc1}" \
88 -fcc "${fcc2}" -subject "${subject}" -width 60 -nowhatnowproc || exit 1
90 check
"${expected}" "${actual}"
92 test "${failed:-0}" -eq 0 && rm "${form}"