summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-10-02 14:43:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-10-02 14:43:10 (GMT)
commita21e1b769836e5b589d00985420d87e74c8010e3 (patch)
treef27a292a7ee9b3368b5e5d216654ee7b39982618 /tests
parent2eb36b08a9d7f97e811ba6b7aeaddaa7fbfa812d (diff)
downloadtcl-a21e1b769836e5b589d00985420d87e74c8010e3.zip
tcl-a21e1b769836e5b589d00985420d87e74c8010e3.tar.gz
tcl-a21e1b769836e5b589d00985420d87e74c8010e3.tar.bz2
[bc5b790099] Improper calculation of new dstLimit value. New test io-12.7.
Diffstat (limited to 'tests')
-rw-r--r--tests/io.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/io.test b/tests/io.test
index 7698cea..b8a5ab4 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -1478,6 +1478,39 @@ test io-12.6 {ReadChars: too many chars read} {
}
close $c
} {}
+test io-12.7 {ReadChars: too many chars read [bc5b790099]} {
+ proc driver {cmd args} {
+ variable buffer
+ variable index
+ set chan [lindex $args 0]
+ switch -- $cmd {
+ initialize {
+ set index($chan) 0
+ set buffer($chan) [encoding convertto utf-8 \
+ [string repeat \uBEEF 10]....\uBEEF]
+ return {initialize finalize watch read}
+ }
+ finalize {
+ unset index($chan) buffer($chan)
+ return
+ }
+ watch {}
+ read {
+ set n [lindex $args 1]
+ set new [expr {$index($chan) + $n}]
+ set result [string range $buffer($chan) $index($chan) $new-1]
+ set index($chan) $new
+ return $result
+ }
+ }
+ }
+ set c [chan create read [namespace which driver]]
+ chan configure $c -encoding utf-8
+ while {![eof $c]} {
+ read $c 7
+ }
+ close $c
+} {}
test io-13.1 {TranslateInputEOL: cr mode} {} {
set f [open $path(test1) w]