summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-04-15 13:25:28 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-04-15 13:25:28 (GMT)
commit7962f209ac44d657c1c2d251a2647711f5add87f (patch)
tree2e36038098aa04bb89e97c66f768f8aee034d6b7 /tests/io.test
parentafacee3f07729501638d6afc6f21bee9c01ef7f2 (diff)
downloadtcl-7962f209ac44d657c1c2d251a2647711f5add87f.zip
tcl-7962f209ac44d657c1c2d251a2647711f5add87f.tar.gz
tcl-7962f209ac44d657c1c2d251a2647711f5add87f.tar.bz2
Extend test io-75.15 to read invalid bytes in binary mode and then use [gets]
to retrieve last two lines.
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/io.test b/tests/io.test
index 7a35e0e..d98317a 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -9491,11 +9491,20 @@ test io-75.15 {
lappend res $status $cres
set status [catch {gets $chan} cres copts]
lappend res $status $cres
+ chan configure $chan -translation binary
+ set data [read $chan 4]
+ foreach char [split $data {}] {
+ scan $char %c ord
+ lappend res [format %x $ord]
+ }
+ fconfigure $chan -encoding utf-8 -profile strict
+ lappend res [gets $chan]
+ lappend res [gets $chan]
return $res
} -cleanup {
close $chan
} -match glob -result {hello AB 1 {error reading "*": invalid or incomplete multibyte or wide character}\
- 1 {error reading "*": invalid or incomplete multibyte or wide character}}
+ 1 {error reading "*": invalid or incomplete multibyte or wide character} 43 44 c0 40 EF GHI}
# ### ### ### ######### ######### #########