summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-05-16 12:56:01 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-05-16 12:56:01 (GMT)
commit8019dad5cd3e9bb29762e4d700f067eed9873084 (patch)
treee45bf1321588ba124a078ebf0bf80f57ca3b4f5d /tests/io.test
parent564d1813daa4ebd962bcafa76e4ce48659d16a26 (diff)
downloadtcl-8019dad5cd3e9bb29762e4d700f067eed9873084.zip
tcl-8019dad5cd3e9bb29762e4d700f067eed9873084.tar.gz
tcl-8019dad5cd3e9bb29762e4d700f067eed9873084.tar.bz2
More tests to demo the bug more directly.
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/io.test b/tests/io.test
index b28566b..53b7105 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -1559,6 +1559,45 @@ test io-13.8 {TranslateInputEOL: auto mode: \r\n} {
close $f
set x
} "abcd\ndef"
+test io-13.8.1 {TranslateInputEOL: auto mode: \r\n} {
+ set f [open $path(test1) w]
+ fconfigure $f -translation lf
+ puts -nonewline $f "abcd\r\ndef"
+ close $f
+ set f [open $path(test1)]
+ fconfigure $f -translation auto
+ set x {}
+ lappend x [read $f 5]
+ lappend x [read $f]
+ close $f
+ set x
+} [list "abcd\n" "def"]
+test io-13.8.2 {TranslateInputEOL: auto mode: \r\n} {
+ set f [open $path(test1) w]
+ fconfigure $f -translation lf
+ puts -nonewline $f "abcd\r\ndef"
+ close $f
+ set f [open $path(test1)]
+ fconfigure $f -translation auto -buffersize 6
+ set x {}
+ lappend x [read $f 5]
+ lappend x [read $f]
+ close $f
+ set x
+} [list "abcd\n" "def"]
+test io-13.8.3 {TranslateInputEOL: auto mode: \r\n} {
+ set f [open $path(test1) w]
+ fconfigure $f -translation lf
+ puts -nonewline $f "abcd\r\n\r\ndef"
+ close $f
+ set f [open $path(test1)]
+ fconfigure $f -translation auto -buffersize 7
+ set x {}
+ lappend x [read $f 5]
+ lappend x [read $f]
+ close $f
+ set x
+} [list "abcd\n" "\ndef"]
test io-13.9 {TranslateInputEOL: auto mode: \r followed by not \n} {
set f [open $path(test1) w]
fconfigure $f -translation lf