(default_mail_test): Ignore trailing whitespace
Showing
1 changed file
with
18 additions
and
3 deletions
... | @@ -351,16 +351,31 @@ proc default_mail_test { args } { | ... | @@ -351,16 +351,31 @@ proc default_mail_test { args } { |
351 | 351 | ||
352 | set result 0 | 352 | set result 0 |
353 | for {set i 0} {$i < [llength $pattern]} {incr i} { | 353 | for {set i 0} {$i < [llength $pattern]} {incr i} { |
354 | verbose "i=$i, pat=[lindex ${pattern} $i]" 2 | 354 | regsub "\[ \t\]*$" [lindex ${pattern} $i] "" pat |
355 | set pat [lindex ${pattern} $i] | 355 | verbose "i=$i, pat=$pat" 2 |
356 | mail_expect $tmt { | 356 | mail_expect $tmt { |
357 | -ex "$pat\r\n" { | 357 | -ex "$pat" { |
358 | if { $expect_out(buffer) != $expect_out(0,string) } { | 358 | if { $expect_out(buffer) != $expect_out(0,string) } { |
359 | verbose "Got \"$expect_out(buffer)\"" 2 | 359 | verbose "Got \"$expect_out(buffer)\"" 2 |
360 | verbose "instead of expected \"$pat\\r\\n\"" 2 | 360 | verbose "instead of expected \"$pat\\r\\n\"" 2 |
361 | set result 1 | 361 | set result 1 |
362 | break | 362 | break |
363 | } | 363 | } |
364 | mail_expect $tmt { | ||
365 | -re "\[ \t]*\r\n" { } | ||
366 | default { | ||
367 | set result 1 | ||
368 | break | ||
369 | } | ||
370 | timeout { | ||
371 | set result -2 | ||
372 | break | ||
373 | } | ||
374 | eof { | ||
375 | set result -3 | ||
376 | break | ||
377 | } | ||
378 | } | ||
364 | } | 379 | } |
365 | default { | 380 | default { |
366 | set result 1 | 381 | set result 1 | ... | ... |
-
Please register or sign in to post a comment