aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-06-21 14:56:37 +1000
committerSteve Bennett <steveb@workware.net.au>2023-07-04 09:23:43 +1000
commitc25a2752e33601cb188dcefca521a8dc580b9dd6 (patch)
tree94c23e2d9210fa799ddc6317e2a82092220730d7
parent4827854ac5e249ff7f91e9ae0d74f309b2195508 (diff)
downloadjimtcl-c25a2752e33601cb188dcefca521a8dc580b9dd6.zip
jimtcl-c25a2752e33601cb188dcefca521a8dc580b9dd6.tar.gz
jimtcl-c25a2752e33601cb188dcefca521a8dc580b9dd6.tar.bz2
tests: expect.tcl: leave the channel in non-blocking mode
This is simpler now that we can write to a non-blocking socket even if it is "full". Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--tests/expect.tcl3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/expect.tcl b/tests/expect.tcl
index f48d460..6cb03cd 100644
--- a/tests/expect.tcl
+++ b/tests/expect.tcl
@@ -38,6 +38,7 @@ proc expect::spawn {cmd} {
# By default, turn off echo so that we can see just the output, not the input
$m tty echo 0
$m buffering none
+ $m ndelay 1
try {
lappend cmd <@$s >@$s &
set pids [exec {*}$cmd]
@@ -199,7 +200,6 @@ proc expect::spawn {cmd} {
# that matches the pattern
if {[$self handle data {}] == 0} {
$m readable [namespace current]::[lambda {} {m self} {
- $m ndelay 1
try {
set buf [$m read]
if {$buf eq ""} {
@@ -210,7 +210,6 @@ proc expect::spawn {cmd} {
} on error msg {
$self handle eof $msg
}
- $m ndelay 0
}]
set matchinfo(afterid) [after $($timeout * 1e3) [list $self handle timeout]]