diff options
author | dgp <dgp@users.sourceforge.net> | 2015-04-29 18:00:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-04-29 18:00:15 (GMT) |
commit | ade6c2a049cda62730309d282fdf9c65a5daf1c4 (patch) | |
tree | 8359ded3f39de0ece97df1b7228183b607b06390 /tests/io.test | |
parent | e9fd85d5d7cf2ac760a9d177e2d688172cbf9111 (diff) | |
parent | 08228c10689feab82a52980341ed6076e9b3abdc (diff) | |
download | tcl-ade6c2a049cda62730309d282fdf9c65a5daf1c4.zip tcl-ade6c2a049cda62730309d282fdf9c65a5daf1c4.tar.gz tcl-ade6c2a049cda62730309d282fdf9c65a5daf1c4.tar.bz2 |
[894da183c8] Test and fix for regression in flushing blocked channels.
Diffstat (limited to 'tests/io.test')
-rw-r--r-- | tests/io.test | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/tests/io.test b/tests/io.test index d199206..c3e63cc 100644 --- a/tests/io.test +++ b/tests/io.test @@ -7368,7 +7368,7 @@ test io-53.4 {CopyData: background write overflow} {stdio unix openpipe fileeven set result "" fileevent $f1 read [namespace code { append result [read $f1 1024] - if {[string length $result] >= [string length $big]} { + if {[string length $result] >= [string length $big]+1} { set x done } }] @@ -7377,6 +7377,37 @@ test io-53.4 {CopyData: background write overflow} {stdio unix openpipe fileeven set big {} set x } done +test io-53.4.1 {Bug 894da183c8} {stdio fcopy} { + set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n + variable x + for {set x 0} {$x < 12} {incr x} { + append big $big + } + file delete $path(pipe) + set f1 [open $path(pipe) w] + puts $f1 [list file delete $path(test1)] + puts $f1 { + puts ready + set f [open io-53.4.1 w] + fcopy stdin $f -command { set x } + vwait x + close $f + } + puts $f1 "close \[[list open $path(test1) w]]" + close $f1 + set f1 [open "|[list [interpreter] $path(pipe)]" r+] + set result [gets $f1] + fconfigure $f1 -blocking 0 -buffersize 125000 + puts $f1 $big + fconfigure $f1 -blocking 1 + close $f1 + set big {} + while {[catch {glob $path(test1)}]} {after 50} + file delete $path(test1) + set check [file size io-53.4.1] + file delete io-53.4.1 + set check +} 266241 set result {} proc FcopyTestAccept {sock args} { after 1000 "close $sock" |