Commit 577e4753 577e475312e614c8985a2fb14240eb9329e56d99 by Sergey Poznyakoff

Added testsuite for mailcap

1 parent 97887ec6
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2002, Free Software Foundation
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #
18 text/plain; less '%s'; needsterminal
19 entry
20 typefield: text/plain
21 view-command: less '%s'
22 fields[1]: needsterminal
23
24 text/html; gnome-help-browser '%s'; nametemplate=%s.html; test=test -n "$DISPLAY"
25 entry
26 typefield: text/html
27 view-command: gnome-help-browser '%s'
28 fields[1]: nametemplate=%s.html
29 fields[2]: test=test -n "$DISPLAY"
30
31 application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; \
32 copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
33 entry
34 typefield: application/x-troff-man
35 view-command: /usr/bin/nroff -mandoc -Tlatin1
36 fields[1]: copiousoutput
37 fields[2]: print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
38
39 text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; \
40 test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
41 entry
42 typefield: text/plain
43 view-command: shownonascii iso-8859-1 '%s'
44 fields[1]: description="Plain ASCII Text"
45 fields[2]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
46
47 text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; \
48 description="Richtext"; copiousoutput; \
49 test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
50 entry
51 typefield: text/richtext
52 view-command: shownonascii iso-8859-1 -e richtext -p '%s'
53 fields[1]: description="Richtext"
54 fields[2]: copiousoutput
55 fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
56
57 text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; \
58 description="Enriched Text"; \
59 copiousoutput; \
60 test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
61 entry
62 typefield: text/enriched
63 view-command: shownonascii iso-8859-1 -e richtext -e -p '%s'
64 fields[1]: description="Enriched Text"
65 fields[2]: copiousoutput
66 fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
67
68 message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"
69 entry
70 typefield: message/partial
71 view-command: showpartial '%s' %{id} %{number} %{total}
72 fields[1]: description="An incomplete message"
73
74 message/external-body; showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}; needsterminal; description="A reference to data stored in an external location"; composetyped="extcompose '%s"'
75 entry
76 typefield: message/external-body
77 view-command: showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}
78 fields[1]: needsterminal
79 fields[2]: description="A reference to data stored in an external location"
80 fields[3]: composetyped="extcompose '%s"'
81
82 application/x-dvi; /usr/bin/xdvi '%s'; test=test -n "$DISPLAY"; description=TeX DVI file; nametemplate=%s.dvi
83 entry
84 typefield: application/x-dvi
85 view-command: /usr/bin/xdvi '%s'
86 fields[1]: test=test -n "$DISPLAY"
87 fields[2]: description=TeX DVI file
88 fields[3]: nametemplate=%s.dvi
89
90 text/plain; more '%s'; needsterminal
91 entry
92 typefield: text/plain
93 view-command: more '%s'
94 fields[1]: needsterminal
95
96 text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
97 entry
98 typefield: text/html
99 view-command: /usr/bin/links '%s'
100 fields[1]: needsterminal
101 fields[2]: description=HTML Text
102 fields[3]: nametemplate=%s.html
103
104 text/richtext; richtext '%s'; description="Richtext"; copiousoutput
105 entry
106 typefield: text/richtext
107 view-command: richtext '%s'
108 fields[1]: description="Richtext"
109 fields[2]: copiousoutput
110
111 text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput
112 entry
113 typefield: text/enriched
114 view-command: richtext -e '%s'
115 fields[1]: description="Enriched Text"
116 fields[2]: copiousoutput
117
118 text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
119 entry
120 typefield: text/html
121 view-command: /usr/bin/w3m -T text/html '%s'
122 fields[1]: needsterminal
123 fields[2]: description=HTML Text
124 fields[3]: nametemplate=%s.html
125
126 text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
127 entry
128 typefield: text/html
129 view-command: /usr/bin/links -dump '%s'
130 fields[1]: copiousoutput
131 fields[2]: description=HTML Text
132 fields[3]: nametemplate=%s.html
133
134 text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
135 entry
136 typefield: text/html
137 view-command: /usr/bin/lynx -force_html '%s'
138 fields[1]: needsterminal
139 fields[2]: description=HTML Text
140 fields[3]: nametemplate=%s.html
141
142 text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
143 entry
144 typefield: text/html
145 view-command: /usr/bin/w3m -dump -T text/html '%s'
146 fields[1]: copiousoutput
147 fields[2]: description=HTML Text
148 fields[3]: nametemplate=%s.html
149
150 text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text
151 entry
152 typefield: text/html
153 view-command: /usr/bin/html2text '%s'
154 fields[1]: copiousoutput
155 fields[2]: description=HTML Text
156
157 text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
158 entry
159 typefield: text/html
160 view-command: /usr/bin/lynx -dump -force_html '%s'
161 fields[1]: copiousoutput
162 fields[2]: description=HTML Text
163 fields[3]: nametemplate=%s.html
164
165 text/*; less '%s'; needsterminal
166 entry
167 typefield: text/*
168 view-command: less '%s'
169 fields[1]: needsterminal
170
171 text/*; more '%s'; needsterminal
172 entry
173 typefield: text/*
174 view-command: more '%s'
175 fields[1]: needsterminal
176
177 application/x-debian-package; /usr/lib/mime/debian-view '%s'; \
178 needsterminal; description=Debian GNU/Linux Package; \
179 nametemplate=%s.deb
180 entry
181 typefield: application/x-debian-package
182 view-command: /usr/lib/mime/debian-view '%s'
183 fields[1]: needsterminal
184 fields[2]: description=Debian GNU/Linux Package
185 fields[3]: nametemplate=%s.deb
186
187 audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; \
188 nametemplate=%s.au
189 entry
190 typefield: audio/basic
191 view-command: /usr/lib/mime/playaudio '%s'
192 fields[1]: description=Basic uLaw Audio
193 fields[2]: nametemplate=%s.au
194
195 # End of Mailcap
...\ No newline at end of file ...\ No newline at end of file
...@@ -22,7 +22,7 @@ DEJATOOL = mailbox ...@@ -22,7 +22,7 @@ DEJATOOL = mailbox
22 RUNTESTFLAGS = 22 RUNTESTFLAGS =
23 CLEANFILES = *.log 23 CLEANFILES = *.log
24 test_dirs = lib mailbox 24 test_dirs = lib mailbox
25 EXTRA_DIST = Addrs Mime Urls Encode Decode RFC2047 25 EXTRA_DIST = Addrs Mailcap Mime Urls Encode Decode RFC2047
26 26
27 dist-hook: 27 dist-hook:
28 here=`cd $(top_builddir)/$(subdir) && pwd`; \ 28 here=`cd $(top_builddir)/$(subdir) && pwd`; \
......
1 address.exp 1 address.exp
2 base64.exp 2 base64.exp
3 mailcap.exp
3 mime.exp 4 mime.exp
4 rfc2047.exp 5 rfc2047.exp
5 url.exp 6 url.exp
......
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, Free Software Foundation
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 mu_prepare_spools
20
21 set mailcapfile ${MU_DATA_DIR}/mailcap
22 set chan [open ${srcdir}/Mailcap r]
23 set outchan [open "$mailcapfile" w]
24
25 set command ""
26 set state 0
27 set entry 0
28 set pattern [list]
29
30 for {gets $chan line} {![eof $chan]} {gets $chan line} {
31 if {$state == 0} {
32 switch -regexp -- "$line" {
33 "^#.*" { }
34 "^entry" {
35 set state 1
36 incr entry
37 lappend pattern "entry\[${entry}\]"
38 }
39 default {
40 puts $outchan $line
41 }
42 }
43 } else {
44 switch -regexp -- "$line" {
45 "^#.*" { }
46 "^\$" {
47 lappend pattern ""
48 set state 0
49 }
50 default {
51 lappend pattern $line
52 }
53 }
54 }
55 }
56
57 if {$state == 1} {
58 lappend pattern ""
59 }
60
61 close $outchan
62 close $chan
63
64 set MU_TOOL ${top_builddir}/examples/mailcap
65 set MU_TOOL_FLAGS ""
66
67 verbose "INVOKE $pattern"
68 eval mu_exec -message "mailcap" -arg "$mailcapfile" $pattern
69
70 # end of mailcap.exp