summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1998-06-09 13:08:23 (GMT)
committerstanton <stanton>1998-06-09 13:08:23 (GMT)
commitcb4a15daedc1bd750818ce0ae24098b6454e7dc0 (patch)
treef313df37be69ca40b7be83c3c2a21d164a74e9ab
parent64e1a8813e310780f1f8c4a9ddb31132023722b2 (diff)
downloadtcl-cb4a15daedc1bd750818ce0ae24098b6454e7dc0.zip
tcl-cb4a15daedc1bd750818ce0ae24098b6454e7dc0.tar.gz
tcl-cb4a15daedc1bd750818ce0ae24098b6454e7dc0.tar.bz2
*** empty log message ***
-rw-r--r--tests/io.test45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/io.test b/tests/io.test
index 2b6670f..1cde686 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -5125,6 +5125,51 @@ test io-33.1 {ChannelTimerProc} {
lappend result $y
} {2 done}
+test io-34.1 {buffered data and file events, gets} {
+ proc accept {sock args} {
+ set ::s2 $sock
+ }
+ set server [socket -server accept 4040]
+ set s [socket localhost 4040]
+ vwait s2
+ update
+ fileevent $s2 readable {lappend result readable}
+ puts $s "12\n34567890"
+ flush $s
+ set result [gets $s2]
+ after 1000 {lappend result timer}
+ vwait result
+ lappend result [gets $s2]
+ vwait result
+ close $s
+ close $s2
+ close $server
+ set result
+} {12 readable 34567890 timer}
+test io-34.2 {buffered data and file events, read} {
+ proc accept {sock args} {
+ set ::s2 $sock
+ }
+ set server [socket -server accept 4040]
+ set s [socket localhost 4040]
+ vwait s2
+ update
+ fileevent $s2 readable {lappend result readable}
+ puts -nonewline $s "1234567890"
+ flush $s
+ set result [read $s2 1]
+ after 1000 {lappend result timer}
+ vwait result
+ lappend result [read $s2 9]
+ vwait result
+ close $s
+ close $s2
+ close $server
+ set result
+} {1 readable 234567890 timer}
+
+
+
removeFile fooBar
removeFile longfile
removeFile script