From 7962f209ac44d657c1c2d251a2647711f5add87f Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sat, 15 Apr 2023 13:25:28 +0000 Subject: Extend test io-75.15 to read invalid bytes in binary mode and then use [gets] to retrieve last two lines. --- tests/io.test | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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} # ### ### ### ######### ######### ######### -- cgit v0.12