summaryrefslogtreecommitdiffstats
path: root/tests/io.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-09 10:08:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-09 10:08:02 (GMT)
commit5b0be625362e6884c5276718ba911a3d292cf1c1 (patch)
tree58d0b106e976d7059bec847ab1e468abf999d7dd /tests/io.test
parenta1fb5545852518890326ddcf62f18e05de2425e3 (diff)
downloadtcl-5b0be625362e6884c5276718ba911a3d292cf1c1.zip
tcl-5b0be625362e6884c5276718ba911a3d292cf1c1.tar.gz
tcl-5b0be625362e6884c5276718ba911a3d292cf1c1.tar.bz2
Adapt 2 testcases (io-39.16/io-39.16a), showing that "-encoding" can be shortened to "-en", but not to "-e" (because there is -eofchar too)
Diffstat (limited to 'tests/io.test')
-rw-r--r--tests/io.test15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/io.test b/tests/io.test
index ca7bd0c..6d556da 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -5607,13 +5607,20 @@ test io-39.15 {Tcl_SetChannelOption: -encoding, binary & utf-8} {
close $f
set x
} \u7266
-test io-39.16 {Tcl_SetChannelOption: -encoding, errors} {
+test io-39.16 {Tcl_SetChannelOption: -encoding (shortened to "-en"), errors} -body {
file delete $path(test1)
set f [open $path(test1) w]
- set result [list [catch {fconfigure $f -encoding foobar} msg] $msg]
+ fconfigure $f -en foobar
+} -cleanup {
close $f
- set result
-} {1 {unknown encoding "foobar"}}
+} -returnCodes 1 -result {unknown encoding "foobar"}
+test io-39.16a {Tcl_SetChannelOption: -encoding (invalid shortening to "-e"), errors} -body {
+ file delete $path(test1)
+ set f [open $path(test1) w]
+ fconfigure $f -e foobar
+} -cleanup {
+ close $f
+} -returnCodes 1 -result {bad option "-e": should be one of -blocking, -buffering, -buffersize, -encoding, -eofchar, or -translation}
test io-39.17 {Tcl_SetChannelOption: -encoding, clearing CHANNEL_NEED_MORE_DATA} {stdio fileevent} {
set f [open "|[list [interpreter] $path(cat)]" r+]
fconfigure $f -encoding binary