summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2004-04-23 23:40:58 (GMT)
committerandreas_kupries <akupries@shaw.ca>2004-04-23 23:40:58 (GMT)
commit3c6bff5072deff3c93b25e7093a21e84b788df3f (patch)
treef1b858e5ab7fa64e398ca3e41444b812b9ac18e9 /tests/io.test
parente4357f99416ff3c38085702ce9524e7d0cca56e1 (diff)
downloadtcl-3c6bff5072deff3c93b25e7093a21e84b788df3f.zip
tcl-3c6bff5072deff3c93b25e7093a21e84b788df3f.tar.gz
tcl-3c6bff5072deff3c93b25e7093a21e84b788df3f.tar.bz2
* generic/tclIO.c (Tcl_SetChannelOption): Fixed [SF Tcl Bug
930851]. When changing the eofchar we have to zap the related flags to prevent them from prematurely aborting the next read.
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/io.test b/tests/io.test
index 8ce7f4e..59d6b72 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -12,7 +12,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.40.2.3 2004/02/25 23:38:16 dgp Exp $
+# RCS: @(#) $Id: io.test,v 1.40.2.4 2004/04/23 23:40:59 andreas_kupries Exp $
if {[catch {package require tcltest 2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2 required."
@@ -7109,6 +7109,23 @@ test io-60.1 {writing illegal utf sequences} {openpipe fileevent} {
} {1 {gets {} catch {error writing "stdout": invalid argument}}}
+set datafile [file join $::tcltest::testsDirectory eofchar.data]
+
+test io-61.1 {Reset eof state after changing the eof char} {
+ set f [open $datafile r]
+ fconfigure $f -eofchar =
+ lappend res [read $f; tell $f]
+ fconfigure $f -eofchar {}
+ lappend res [read $f 1]
+ lappend res [read $f; tell $f]
+ # Any seek zaps the internals into a good state.
+ #seek $f 0 start
+ #seek $f 0 current
+ #lappend res [read $f; tell $f]
+ close $f
+ set res
+} {77 = 23431}
+
# cleanup