summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/io.test18
-rw-r--r--tests/winFCmd.test3
2 files changed, 16 insertions, 5 deletions
diff --git a/tests/io.test b/tests/io.test
index 4643a36..5a2abbe 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -5677,13 +5677,23 @@ test io-39.15 {Tcl_SetChannelOption: -encoding, binary & utf-8} {
close $f
set x
} 牦
-test io-39.16 {Tcl_SetChannelOption: -encoding, errors} {
+# Remove knownProfileBug constraint below post TIP656- TODO
+test io-39.16 {Tcl_SetChannelOption: -encoding (shortened to "-en"), errors} -constraints {
+ knownProfileBug
+} -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, -encodingprofile, -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
diff --git a/tests/winFCmd.test b/tests/winFCmd.test
index 5ebce10..3be1920 100644
--- a/tests/winFCmd.test
+++ b/tests/winFCmd.test
@@ -250,8 +250,9 @@ test winFCmd-1.23 {TclpRenameFile: move dir into self} -setup {
test winFCmd-1.24 {TclpRenameFile: move a root dir} -setup {
cleanup
} -constraints {win testfile} -body {
+ # Error code depends on Windows version
testfile mv / c:/
-} -returnCodes error -result EINVAL
+} -returnCodes error -result {^(EINVAL|ENOENT)$} -match regexp
test winFCmd-1.25 {TclpRenameFile: cross file systems} -setup {
cleanup
} -constraints {win cdrom testfile} -body {