summaryrefslogtreecommitdiff
path: root/mail.remote/testsuite/mail.remote/send.exp
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-11-03 12:49:11 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-11-03 12:49:11 +0000
commitba8d24dc1948887701a669a256dd11a2dc3506d7 (patch)
tree3973b3e55ba03d8b206d2b7b03129247e0ad5850 /mail.remote/testsuite/mail.remote/send.exp
parenta14c8fcb1584b5c5287c81e27015d6b753b720e4 (diff)
downloadmailutils-ba8d24dc1948887701a669a256dd11a2dc3506d7.tar.gz
mailutils-ba8d24dc1948887701a669a256dd11a2dc3506d7.tar.bz2
Framework for testing mail.remote
Diffstat (limited to 'mail.remote/testsuite/mail.remote/send.exp')
-rw-r--r--mail.remote/testsuite/mail.remote/send.exp83
1 files changed, 83 insertions, 0 deletions
diff --git a/mail.remote/testsuite/mail.remote/send.exp b/mail.remote/testsuite/mail.remote/send.exp
new file mode 100644
index 000000000..a2cd1b8ad
--- /dev/null
+++ b/mail.remote/testsuite/mail.remote/send.exp
@@ -0,0 +1,83 @@
+# -*- 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.
+
+set chan [open ${srcdir}/Data r]
+
+set state 0
+set command ""
+for {gets $chan line} {![eof $chan]} {gets $chan line} {
+ verbose "LINE $line" 1
+ switch -regexp -- "$line" {
+ "^#.*" { }
+ "^MESSAGE END" {
+ verbose "MAIL FROM $from" 1
+ verbose "MAIL TO $to" 1
+ verbose "INPUT $input" 1
+ verbose "PATTERN $pattern" 1
+ set args ""
+ if {$from != ""} {
+ append args " --from $from"
+ }
+ if {$to != ""} {
+ append args " $to"
+ }
+ mailer_remote_test -message $message -input $input -pattern $pattern -args $args
+ set state 0
+ }
+ "^MESSAGE" {
+ regexp "^MESSAGE (.*)" $line dummy message
+ set from ""
+ set to ""
+ set input [list]
+ set pattern [list]
+ set state 1
+ }
+ "^FROM" {
+ regexp "^FROM (.*)" $line dummy from
+ }
+ "^TO" {
+ regexp "^TO (.*)" $line dummy to
+ }
+ "^BODY BEGIN" {
+ set state 2
+ }
+ "^BODY END" {
+ set state 1
+ }
+ "^PATTERN BEGIN" {
+ set state 3
+ }
+ "^PATTERN END" {
+ set state 1
+ }
+ "^STOP" {
+ break
+ }
+ default {
+ if {$state == 2} {
+ lappend input $line
+ } elseif {$state == 3} {
+ lappend pattern $line
+ }
+ }
+ }
+}
+
+close $chan
+
+# End of send.exp \ No newline at end of file

Return to:

Send suggestions and report system problems to the System administrator.