summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2022-07-22 17:36:57 (GMT)
committersebres <sebres@users.sourceforge.net>2022-07-22 17:36:57 (GMT)
commit49f09ae8c228ad19029f35a4f40ba6dc6c5d5fff (patch)
treec3324e7a2ee7950f226f66ae17ad67df25409451 /tests/io.test
parentc3cc26df50b8e700e15a735e75defe3b0e7c1275 (diff)
downloadtcl-49f09ae8c228ad19029f35a4f40ba6dc6c5d5fff.zip
tcl-49f09ae8c228ad19029f35a4f40ba6dc6c5d5fff.tar.gz
tcl-49f09ae8c228ad19029f35a4f40ba6dc6c5d5fff.tar.bz2
extends test io-29.36.2 for better illustration when we'll get extra NL - if no "\r" in last buffer, so only EOF causes exit from gets (flag INPUT_SAW_CR gets reset incorrectly)
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/io.test b/tests/io.test
index 8df28ba..3b374c1 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -3054,11 +3054,15 @@ test io-29.36.2 {gets on translation auto with "\r\n" in different buffers, bug
} else {
# we don't have a delay, so client would get the lines as single chunk
}
+ # we'll try with "\r" and without "\r" (to cover both branches, where "\r" and "eof" causes exit from [gets] by 3rd line)
puts -nonewline $so "\n3 line"
+ if {!($::cnt % 3)} {
+ puts -nonewline $so "\r"
+ }
flush $so
close $so
}
- while {$::cnt < 4} { incr ::cnt
+ while {$::cnt < 6} { incr ::cnt
set c [socket 127.0.0.1 [lindex [fconfigure $s -sockname] 2]]
fconfigure $c -blocking 0 -buffering line -translation auto
fileevent $c readable [list apply {c {
@@ -3076,7 +3080,7 @@ test io-29.36.2 {gets on translation auto with "\r\n" in different buffers, bug
close $s
if {$c ne {}} { close $c }
unset -nocomplain ::done ::cli ::cnt s c
-} -result [lrepeat 4 {<1 line>} {<2 line>} {<3 line>}]
+} -result [lrepeat 6 {<1 line>} {<2 line>} {<3 line>}]
# Test end of line translations. Procedures tested are Tcl_Write, Tcl_Read.