summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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