summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-07-24 15:00:07 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-07-24 15:00:07 (GMT)
commit36ec4e104487d2d718dc0a62e145afa4bdfecafc (patch)
treee582791a60a0fb921c344b9a1844c23411838b4a
parent91e311e52d7fd08f0eb70ddd211e5aa51a5e2d22 (diff)
downloadtcl-36ec4e104487d2d718dc0a62e145afa4bdfecafc.zip
tcl-36ec4e104487d2d718dc0a62e145afa4bdfecafc.tar.gz
tcl-36ec4e104487d2d718dc0a62e145afa4bdfecafc.tar.bz2
Test read error during binary [chan copy].
-rw-r--r--tests/io.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/io.test b/tests/io.test
index bf5adb0..b707c01 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -7612,6 +7612,36 @@ test io-53.12 {CopyData: foreground short reads, aka bug 3096275} {stdio unix op
close $f1
list $::done $ch
} {ok A}
+test io-53.13 {TclCopyChannel: read error reporting} -setup {
+ proc driver {cmd args} {
+ variable buffer
+ variable index
+ set chan [lindex $args 0]
+ switch -- $cmd {
+ initialize {
+ return {initialize finalize watch read}
+ }
+ finalize {
+ return
+ }
+ watch {}
+ read {
+ error FAIL
+ }
+ }
+ }
+ set outFile [makeFile {} out]
+} -body {
+ set in [chan create read [namespace which driver]]
+ chan configure $in -translation binary
+ set out [open $outFile wb]
+ chan copy $in $out
+} -cleanup {
+ catch {close $in}
+ catch {close $out}
+ removeFile out
+ rename driver {}
+} -result {error reading "*": *} -returnCodes error -match glob
test io-54.1 {Recursive channel events} {socket fileevent} {
# This test checks to see if file events are delivered during recursive