summaryrefslogtreecommitdiffstats
path: root/tests/iogt.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-11-06 16:12:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-11-06 16:12:26 (GMT)
commit559b8ab9de85a070d0dc00c5a8fb397c9baa7d6c (patch)
treef8b76525d88e681667025f5f174e1baf8f3cd720 /tests/iogt.test
parent60ef43cb8cfe3c26e4e48d6af300ef5011ac44f9 (diff)
downloadtcl-559b8ab9de85a070d0dc00c5a8fb397c9baa7d6c.zip
tcl-559b8ab9de85a070d0dc00c5a8fb397c9baa7d6c.tar.gz
tcl-559b8ab9de85a070d0dc00c5a8fb397c9baa7d6c.tar.bz2
Also test transfroms that delay.
Diffstat (limited to 'tests/iogt.test')
-rw-r--r--tests/iogt.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/iogt.test b/tests/iogt.test
index 1a18afc..89e62d4 100644
--- a/tests/iogt.test
+++ b/tests/iogt.test
@@ -1039,6 +1039,36 @@ test iogt-7.0 {Handle fleeting EOF} -constraints {testchannel} -body {
close $chan
} -result {0 ..... 1 {} 0 ..... 1}
+proc delay {op data} {
+ variable store
+ switch -- $op {
+ create/write - create/read -
+ delete/write - delete/read -
+ flush/write - write -
+ clear_read {;#ignore}
+ flush/read -
+ read {
+ if {![info exists store]} {set store {}}
+ set reply $store
+ set store $data
+ return $reply
+ }
+ query/maxRead {return -1}
+ }
+}
+
+test iogt-7.1 {Handle fleeting EOF} -constraints {testchannel} -body {
+ set chan [chan create read [namespace which driver]]
+ testchannel transform $chan -command [namespace code delay]
+ list [eof $chan] [read $chan] [eof $chan] [read $chan 0] [eof $chan] \
+ [read $chan] [eof $chan]
+} -cleanup {
+ close $chan
+} -result {0 ..... 1 {} 0 ..... 1}
+
+rename delay {}
+rename driver {}
+
# cleanup
foreach file [list dummy dummyout __echo_srv__.tcl] {
removeFile $file