diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2009-11-12 17:25:17 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2009-11-12 17:25:17 (GMT) |
commit | 21eed95f82fd87a20b11cd92a29d9dfbf06d2e63 (patch) | |
tree | 7bdcd74fc2ad492eabc6dd73fea2dd236a3f831c /tests | |
parent | 63f0ec7e525485316afd7462f1fbdd2a9f2fd645 (diff) | |
download | tcl-21eed95f82fd87a20b11cd92a29d9dfbf06d2e63.zip tcl-21eed95f82fd87a20b11cd92a29d9dfbf06d2e63.tar.gz tcl-21eed95f82fd87a20b11cd92a29d9dfbf06d2e63.tar.bz2 |
* generic/tclIO.c (CopyData): [Bug 2895565]. Dropped bogosity
* tests/io.test: which used the number of _written_ bytes or
character to update the counters for the read bytes/characters.
New test io-53.11. This is a forward port from the 8.5 branch.
FossilOrigin-Name: bee5fce25329b625a85433ecbff1730b677937e1
Diffstat (limited to 'tests')
-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 0ab8909..1ad9f6e 100644 --- a/tests/io.test +++ b/tests/io.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: io.test,v 1.93 2008/12/19 17:07:47 dgp Exp $ +# RCS: @(#) $Id: io.test,v 1.94 2009/11/12 17:25:18 andreas_kupries Exp $ if {[catch {package require tcltest 2}]} { puts stderr "Skipping tests in [info script]. tcltest 2 required." @@ -7126,6 +7126,37 @@ test io-53.10 {Bug 1350564, multi-directional fcopy} -setup { removeFile err catch {unset ::forever} } -result {AB BA} +test io-53.11 {Bug 2895565} -setup { + set in [makeFile {} in] + set f [open $in w] + fconfigure $f -encoding utf-8 -translation binary + puts -nonewline $f [string repeat "Ho hum\n" 11] + close $f + set inChan [open $in r] + fconfigure $inChan -translation binary + set out [makeFile {} out] + set outChan [open $out w] + fconfigure $outChan -encoding cp1252 -translation crlf + proc CopyDone {bytes args} { + variable done + if {[llength $args]} { + set done "Error: '[lindex $args 0]' after $bytes bytes copied" + } else { + set done "$bytes bytes copied" + } + } +} -body { + variable done + after 2000 [list set [namespace which -variable done] timeout] + fcopy $inChan $outChan -size 40 -command [namespace which CopyDone] + vwait [namespace which -variable done] + set done +} -cleanup { + close $outChan + close $inChan + removeFile out + removeFile in +} -result {40 bytes copied} test io-54.1 {Recursive channel events} {socket fileevent} { # This test checks to see if file events are delivered during recursive |