diff options
Diffstat (limited to 'tests/io.test')
-rw-r--r-- | tests/io.test | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/io.test b/tests/io.test index 6e82dd3..583e333 100644 --- a/tests/io.test +++ b/tests/io.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: io.test,v 1.4 1998/09/14 18:40:10 stanton Exp $ +# RCS: @(#) $Id: io.test,v 1.5 1998/10/30 00:38:39 welch Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -5169,6 +5169,31 @@ test io-34.2 {buffered data and file events, read} { set result } {1 readable 234567890 timer} +test io-35.1 {Tcl_NotifyChannel and error when closing} {unixOrPc} { + set out [open script w] + puts $out { + puts "normal message from pipe" + puts stderr "error message from pipe" + exit 1 + } + proc readit {pipe} { + global x result + if {[eof $pipe]} { + set x [catch {close $pipe} line] + lappend result catch $line + } else { + gets $pipe line + lappend result gets $line + } + } + close $out + set pipe [open "|$tcltest script" r] + fileevent $pipe readable [list readit $pipe] + set x "" + set result "" + vwait x + list $x $result +} {1 {gets {normal message from pipe} gets {} catch {error message from pipe}}} removeFile fooBar |