summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwelch <welch>1998-10-30 00:38:28 (GMT)
committerwelch <welch>1998-10-30 00:38:28 (GMT)
commit87056a32f65f4451dea20f209b70ca64277453ad (patch)
treef812290afe768219222e9256236b5169d9ba5820 /tests
parent4cc4398f8553944112e0594446a0b88c3fa96e7a (diff)
downloadtcl-87056a32f65f4451dea20f209b70ca64277453ad.zip
tcl-87056a32f65f4451dea20f209b70ca64277453ad.tar.gz
tcl-87056a32f65f4451dea20f209b70ca64277453ad.tar.bz2
Fixed the Tcl_NotifyChannel bug, plus added a test case for it.
Simply replaced Tcl_RegisterChannel/UnregisterChannel with Tcl_Preserve/Tcl_Release was all it took. Chanels are already "eventually freed"
Diffstat (limited to 'tests')
-rw-r--r--tests/io.test27
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