summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-10-10 20:02:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-10-10 20:02:00 (GMT)
commit61bb4f72ffe5a564476a0d33e12ddc2fa4eea9c1 (patch)
treeeb4c19ceaf4d3326236f20a034a87181457802f0 /tests/io.test
parente059101eedfd4f4901b73f983842b9d1c6e45098 (diff)
downloadtcl-61bb4f72ffe5a564476a0d33e12ddc2fa4eea9c1.zip
tcl-61bb4f72ffe5a564476a0d33e12ddc2fa4eea9c1.tar.gz
tcl-61bb4f72ffe5a564476a0d33e12ddc2fa4eea9c1.tar.bz2
backport those tests that can be
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/io.test b/tests/io.test
index d1faf65..006b403 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -7610,6 +7610,68 @@ test io-53.11 {Bug 2895565} -setup {
removeFile in
} -result {40 bytes copied}
+# test io-53.12 not backported. Tests feature only in 8.6+
+
+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-53.14 {TclCopyChannel: write error reporting} -setup {
+ proc driver {cmd args} {
+ variable buffer
+ variable index
+ set chan [lindex $args 0]
+ switch -- $cmd {
+ initialize {
+ return {initialize finalize watch write}
+ }
+ finalize {
+ return
+ }
+ watch {}
+ write {
+ error FAIL
+ }
+ }
+ }
+ set inFile [makeFile {aaa} in]
+} -body {
+ set in [open $inFile rb]
+ set out [chan create write [namespace which driver]]
+ chan configure $out -translation binary
+ chan copy $in $out
+} -cleanup {
+ catch {close $in}
+ catch {close $out}
+ removeFile in
+ rename driver {}
+} -result {error writing "*": *} -returnCodes error -match glob
test io-53.15 {[ed29c4da21] DoRead: fblocked seen as error} -setup {
proc driver {cmd args} {
variable buffer