summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-02-24 10:32:06 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-02-24 10:32:06 +0000
commit577e475312e614c8985a2fb14240eb9329e56d99 (patch)
treedae21d1b72aebb105877eec58ae14f65abdef9a0
parent97887ec6c94cf0770c0ba9072ab167552128a1b0 (diff)
downloadmailutils-577e475312e614c8985a2fb14240eb9329e56d99.tar.gz
mailutils-577e475312e614c8985a2fb14240eb9329e56d99.tar.bz2
Added testsuite for mailcap
-rw-r--r--mailbox/testsuite/Mailcap195
-rw-r--r--mailbox/testsuite/Makefile.am2
-rw-r--r--mailbox/testsuite/mailbox/DISTFILES1
-rw-r--r--mailbox/testsuite/mailbox/mailcap.exp70
4 files changed, 267 insertions, 1 deletions
diff --git a/mailbox/testsuite/Mailcap b/mailbox/testsuite/Mailcap
new file mode 100644
index 000000000..e0fa7f281
--- /dev/null
+++ b/mailbox/testsuite/Mailcap
@@ -0,0 +1,195 @@
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+text/plain; less '%s'; needsterminal
+entry
+ typefield: text/plain
+ view-command: less '%s'
+ fields[1]: needsterminal
+
+text/html; gnome-help-browser '%s'; nametemplate=%s.html; test=test -n "$DISPLAY"
+entry
+ typefield: text/html
+ view-command: gnome-help-browser '%s'
+ fields[1]: nametemplate=%s.html
+ fields[2]: test=test -n "$DISPLAY"
+
+application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; \
+copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
+entry
+ typefield: application/x-troff-man
+ view-command: /usr/bin/nroff -mandoc -Tlatin1
+ fields[1]: copiousoutput
+ fields[2]: print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
+
+text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; \
+test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
+entry
+ typefield: text/plain
+ view-command: shownonascii iso-8859-1 '%s'
+ fields[1]: description="Plain ASCII Text"
+ fields[2]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
+
+text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; \
+description="Richtext"; copiousoutput; \
+test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
+entry
+ typefield: text/richtext
+ view-command: shownonascii iso-8859-1 -e richtext -p '%s'
+ fields[1]: description="Richtext"
+ fields[2]: copiousoutput
+ fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
+
+text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; \
+description="Enriched Text"; \
+copiousoutput; \
+test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
+entry
+ typefield: text/enriched
+ view-command: shownonascii iso-8859-1 -e richtext -e -p '%s'
+ fields[1]: description="Enriched Text"
+ fields[2]: copiousoutput
+ fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
+
+message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"
+entry
+ typefield: message/partial
+ view-command: showpartial '%s' %{id} %{number} %{total}
+ fields[1]: description="An incomplete message"
+
+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"'
+entry
+ typefield: message/external-body
+ view-command: showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}
+ fields[1]: needsterminal
+ fields[2]: description="A reference to data stored in an external location"
+ fields[3]: composetyped="extcompose '%s"'
+
+application/x-dvi; /usr/bin/xdvi '%s'; test=test -n "$DISPLAY"; description=TeX DVI file; nametemplate=%s.dvi
+entry
+ typefield: application/x-dvi
+ view-command: /usr/bin/xdvi '%s'
+ fields[1]: test=test -n "$DISPLAY"
+ fields[2]: description=TeX DVI file
+ fields[3]: nametemplate=%s.dvi
+
+text/plain; more '%s'; needsterminal
+entry
+ typefield: text/plain
+ view-command: more '%s'
+ fields[1]: needsterminal
+
+text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
+entry
+ typefield: text/html
+ view-command: /usr/bin/links '%s'
+ fields[1]: needsterminal
+ fields[2]: description=HTML Text
+ fields[3]: nametemplate=%s.html
+
+text/richtext; richtext '%s'; description="Richtext"; copiousoutput
+entry
+ typefield: text/richtext
+ view-command: richtext '%s'
+ fields[1]: description="Richtext"
+ fields[2]: copiousoutput
+
+text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput
+entry
+ typefield: text/enriched
+ view-command: richtext -e '%s'
+ fields[1]: description="Enriched Text"
+ fields[2]: copiousoutput
+
+text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
+entry
+ typefield: text/html
+ view-command: /usr/bin/w3m -T text/html '%s'
+ fields[1]: needsterminal
+ fields[2]: description=HTML Text
+ fields[3]: nametemplate=%s.html
+
+text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
+entry
+ typefield: text/html
+ view-command: /usr/bin/links -dump '%s'
+ fields[1]: copiousoutput
+ fields[2]: description=HTML Text
+ fields[3]: nametemplate=%s.html
+
+text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
+entry
+ typefield: text/html
+ view-command: /usr/bin/lynx -force_html '%s'
+ fields[1]: needsterminal
+ fields[2]: description=HTML Text
+ fields[3]: nametemplate=%s.html
+
+text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
+entry
+ typefield: text/html
+ view-command: /usr/bin/w3m -dump -T text/html '%s'
+ fields[1]: copiousoutput
+ fields[2]: description=HTML Text
+ fields[3]: nametemplate=%s.html
+
+text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text
+entry
+ typefield: text/html
+ view-command: /usr/bin/html2text '%s'
+ fields[1]: copiousoutput
+ fields[2]: description=HTML Text
+
+text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
+entry
+ typefield: text/html
+ view-command: /usr/bin/lynx -dump -force_html '%s'
+ fields[1]: copiousoutput
+ fields[2]: description=HTML Text
+ fields[3]: nametemplate=%s.html
+
+text/*; less '%s'; needsterminal
+entry
+ typefield: text/*
+ view-command: less '%s'
+ fields[1]: needsterminal
+
+text/*; more '%s'; needsterminal
+entry
+ typefield: text/*
+ view-command: more '%s'
+ fields[1]: needsterminal
+
+application/x-debian-package; /usr/lib/mime/debian-view '%s'; \
+needsterminal; description=Debian GNU/Linux Package; \
+nametemplate=%s.deb
+entry
+ typefield: application/x-debian-package
+ view-command: /usr/lib/mime/debian-view '%s'
+ fields[1]: needsterminal
+ fields[2]: description=Debian GNU/Linux Package
+ fields[3]: nametemplate=%s.deb
+
+audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; \
+nametemplate=%s.au
+entry
+ typefield: audio/basic
+ view-command: /usr/lib/mime/playaudio '%s'
+ fields[1]: description=Basic uLaw Audio
+ fields[2]: nametemplate=%s.au
+
+# End of Mailcap \ No newline at end of file
diff --git a/mailbox/testsuite/Makefile.am b/mailbox/testsuite/Makefile.am
index e102adbf9..7508c3cc0 100644
--- a/mailbox/testsuite/Makefile.am
+++ b/mailbox/testsuite/Makefile.am
@@ -24,3 +24,3 @@ CLEANFILES = *.log
test_dirs = lib mailbox
-EXTRA_DIST = Addrs Mime Urls Encode Decode RFC2047
+EXTRA_DIST = Addrs Mailcap Mime Urls Encode Decode RFC2047
diff --git a/mailbox/testsuite/mailbox/DISTFILES b/mailbox/testsuite/mailbox/DISTFILES
index 8fcce113b..480e3592a 100644
--- a/mailbox/testsuite/mailbox/DISTFILES
+++ b/mailbox/testsuite/mailbox/DISTFILES
@@ -2,2 +2,3 @@ address.exp
base64.exp
+mailcap.exp
mime.exp
diff --git a/mailbox/testsuite/mailbox/mailcap.exp b/mailbox/testsuite/mailbox/mailcap.exp
new file mode 100644
index 000000000..bb265d92a
--- /dev/null
+++ b/mailbox/testsuite/mailbox/mailcap.exp
@@ -0,0 +1,70 @@
+# -*- tcl -*-
+# This file is part of Mailutils testsuite.
+# Copyright (C) 2002, Free Software Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+mu_prepare_spools
+
+set mailcapfile ${MU_DATA_DIR}/mailcap
+set chan [open ${srcdir}/Mailcap r]
+set outchan [open "$mailcapfile" w]
+
+set command ""
+set state 0
+set entry 0
+set pattern [list]
+
+for {gets $chan line} {![eof $chan]} {gets $chan line} {
+ if {$state == 0} {
+ switch -regexp -- "$line" {
+ "^#.*" { }
+ "^entry" {
+ set state 1
+ incr entry
+ lappend pattern "entry\[${entry}\]"
+ }
+ default {
+ puts $outchan $line
+ }
+ }
+ } else {
+ switch -regexp -- "$line" {
+ "^#.*" { }
+ "^\$" {
+ lappend pattern ""
+ set state 0
+ }
+ default {
+ lappend pattern $line
+ }
+ }
+ }
+}
+
+if {$state == 1} {
+ lappend pattern ""
+}
+
+close $outchan
+close $chan
+
+set MU_TOOL ${top_builddir}/examples/mailcap
+set MU_TOOL_FLAGS ""
+
+verbose "INVOKE $pattern"
+eval mu_exec -message "mailcap" -arg "$mailcapfile" $pattern
+
+# end of mailcap.exp

Return to:

Send suggestions and report system problems to the System administrator.