/[mailutils]/mailutils/mail/testsuite/lib/mail.exp
ViewVC logotype

Diff of /mailutils/mail/testsuite/lib/mail.exp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by gray, Tue Jul 2 14:56:39 2002 UTC revision 1.2 by gray, Wed Jul 3 15:46:50 2002 UTC
# Line 124  verbose "MAILRC is $srcdir/etc/mail.rc" Line 124  verbose "MAILRC is $srcdir/etc/mail.rc"
124              return 1              return 1
125          }          }
126      }      }
127        mail_send "#\n"
128      return 0      return 0
129  }  }
130    
# Line 153  proc mail_send { string } { Line 154  proc mail_send { string } {
154  }  }
155    
156  proc mail_command { cmd } {  proc mail_command { cmd } {
157        global mail_prompt
158        mail_expect 30 {
159            -re "\[\r\n\]?${mail_prompt}$" {}
160            default {
161                perror "mail not initialized"
162                return 1
163            }
164        }
165      set res [mail_send "$cmd\n"]      set res [mail_send "$cmd\n"]
166      mail_expect 30 {      mail_expect 30 {
167          -ex "${cmd}\r\n" { }          -ex "${cmd}\r\n" { }
# Line 208  proc mail_expect { args } { Line 217  proc mail_expect { args } {
217              }              }
218          }          }
219      }      }
220    
221      global suppress_flag;      global suppress_flag;
222      global remote_suppress_flag;      global remote_suppress_flag;
223      global verbose      global verbose
# Line 220  proc mail_expect { args } { Line 230  proc mail_expect { args } {
230          }          }
231      }      }
232    
233      verbose "RUNNING remote_expect host $gtimeout $notransfer" 2      verbose "RUNNING remote_expect host $gtimeout $notransfer $expcode" 2
234    
235      set code [catch \      set code [catch \
236          {uplevel remote_expect host "$gtimeout $notransfer" $expcode} string];          {uplevel remote_expect host $gtimeout $notransfer $expcode} string];
237      if [info exists old_val] {      if [info exists old_val] {
238          set remote_suppress_flag $old_val;          set remote_suppress_flag $old_val;
239      } else {      } else {
# Line 296  proc default_mail_test { args } { Line 306  proc default_mail_test { args } {
306      set result 0      set result 0
307      for {set i 0} {$i < [llength $pattern]} {incr i} {      for {set i 0} {$i < [llength $pattern]} {incr i} {
308          verbose "i=$i, pat=[lindex ${pattern} $i]" 2          verbose "i=$i, pat=[lindex ${pattern} $i]" 2
309            set pat [lindex ${pattern} $i]
310          mail_expect $tmt {          mail_expect $tmt {
311              -ex "[lindex ${pattern} $i]" { }              -ex "$pat\r\n" {
312              -ex "[lindex ${pattern} $i]\r\n" { }                  if { $expect_out(buffer) != $expect_out(0,string) } {
313                        verbose "Got \"$expect_out(buffer)\"" 2
314                        verbose "instead of expected \"$pat\\r\\n\"" 2
315                        set result 1
316                        break
317                    }
318                }
319              default {              default {
320                  set result 1                  set result 1
321                  break                  break

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26