]>
diplodocus.org Git - nmh/blob - test/comp/test-comp-format
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
-
17 check_exit
'-eq 1' comp
-xyzzy
18 check_exit
'-eq 0' comp
-help
19 check_exit
'-eq 0' comp
-version
20 check_exit
'-eq 1' comp
-build -noedit -editor
21 check_exit
'-eq 1' comp
-whatnowproc
22 check_exit
'-eq 1' comp
-whatnowproc '' -
23 check_exit
'-eq 1' comp
-use -nouse -form
24 check_exit
'-eq 1' comp
-file
25 check_exit
'-eq 1' comp
-file foo
-file
26 check_exit
'-eq 1' comp
-nodraftfolder -draftfolder
27 check_exit
'-eq 1' comp
-draftfolder foo
-draftfolder
28 check_exit
'-eq 1' comp
-draftmessage
29 check_exit
'-eq 1' comp
-draftmessage foo
-draftmessage
30 check_exit
'-eq 1' comp
-to
31 check_exit
'-eq 1' comp
-cc
32 check_exit
'-eq 1' comp
-from
33 check_exit
'-eq 1' comp
-fcc
34 check_exit
'-eq 1' comp
-fcc @
-
35 check_exit
'-eq 1' comp
-width
36 check_exit
'-eq 1' comp
-width 0
37 check_exit
'-eq 1' comp
-subject
38 check_exit
'-eq 1' comp
+ @
39 check_exit
'-eq 1' comp
42 314
40 check_exit
'-eq 1' comp
-form foo
42
41 check_exit
'-eq 1' comp
+
42 check_exit
'-eq 1' comp
42
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}"