summaryrefslogtreecommitdiffstats
path: root/tests/ioCmd.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-04-10 13:18:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-04-10 13:18:37 (GMT)
commit5c0e1075afd1c466ed8ba3475784cee32172808d (patch)
treeb9560d57cef620034ac72591b80818e357c6c974 /tests/ioCmd.test
parentcd2d193b742daad9a3d56ddfc84cf9f4398825a3 (diff)
downloadtcl-5c0e1075afd1c466ed8ba3475784cee32172808d.zip
tcl-5c0e1075afd1c466ed8ba3475784cee32172808d.tar.gz
tcl-5c0e1075afd1c466ed8ba3475784cee32172808d.tar.bz2
[e155cedf33]: Error-handling in TclGetOpenMode()
Diffstat (limited to 'tests/ioCmd.test')
-rw-r--r--tests/ioCmd.test15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 2b9aed6..91e53fe 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -497,14 +497,14 @@ unmatched open brace in list
\"open \$path(test3) \"FOO \\{BAR BAZ\"\""
test iocmd-12.7 {POSIX open access modes: errors} {
list [catch {open $path(test3) {FOO BAR BAZ}} msg] $msg
-} {1 {invalid access mode "FOO": must be RDONLY, WRONLY, RDWR, APPEND, BINARY, CREAT, EXCL, NOCTTY, NONBLOCK, or TRUNC}}
+} {1 {invalid access mode "FOO": must be APPEND, BINARY, CREAT, EXCL, NOCTTY, NONBLOCK, RDONLY, RDWR, TRUNC, or WRONLY}}
test iocmd-12.8 {POSIX open access modes: errors} {
list [catch {open $path(test3) {TRUNC CREAT}} msg] $msg
-} {1 {access mode must include either RDONLY, WRONLY, or RDWR}}
+} {1 {access mode must include either RDONLY, RDWR, or WRONLY}}
close [open $path(test3) w]
test iocmd-12.9 {POSIX open access modes: BINARY} {
list [catch {open $path(test1) BINARY} msg] $msg
-} {1 {access mode must include either RDONLY, WRONLY, or RDWR}}
+} {1 {access mode must include either RDONLY, RDWR, or WRONLY}}
test iocmd-12.10 {POSIX open access modes: BINARY} {
set f [open $path(test1) {WRONLY BINARY TRUNC}]
puts $f a
@@ -527,6 +527,15 @@ test iocmd-12.11 {POSIX open access modes: BINARY} {
close $f
set result
} H
+test iocmd-12.12 {POSIX open access modes: errors} {
+ list [catch {open $path(test3) {RDWR WRONLY}} msg] $msg
+} {1 {invalid access mode "WRONLY": modes RDONLY, RDWR, and WRONLY cannot be combined}}
+test iocmd-12.13 {POSIX open access modes: errors} {
+ list [catch {open $path(test3) {BINARY BINARY}} msg] $msg
+} {1 {access mode "BINARY" repeated}}
+test iocmd-12.14 {POSIX open access modes: errors} {
+ list [catch {open $path(test3) {TRUNC}} msg] $msg
+} {1 {access mode must include either RDONLY, RDWR, or WRONLY}}
test iocmd-13.1 {errors in open command} {
list [catch {open} msg] $msg