diff options
Diffstat (limited to 'tests/io.test')
-rw-r--r-- | tests/io.test | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/tests/io.test b/tests/io.test index c302958..525baf8 100644 --- a/tests/io.test +++ b/tests/io.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: io.test,v 1.45 2003/03/07 22:03:39 mdejong Exp $ +# RCS: @(#) $Id: io.test,v 1.46 2003/10/07 14:58:29 dgp Exp $ if {[catch {package require tcltest 2}]} { puts stderr "Skipping tests in [info script]. tcltest 2 required." @@ -5220,16 +5220,13 @@ test io-40.5 {POSIX open access modes: APPEND} { close $f set x } {{new line} abc} -test io-40.6 {POSIX open access modes: EXCL} { +test io-40.6 {POSIX open access modes: EXCL} -match regexp -body { removeFile test3 set f [open $path(test3) w] puts $f xyzzy close $f - set msg [list [catch {open $path(test3) {WRONLY CREAT EXCL}} msg] $msg] - regsub " already " $msg " " msg - regsub [file join {} $path(test3)] $msg "test3" msg - string tolower $msg -} {1 {couldn't open "test3": file exists}} + open $path(test3) {WRONLY CREAT EXCL} +} -returnCodes error -result {(?i)couldn't open ".*test3": file (already )?exists} test io-40.7 {POSIX open access modes: EXCL} { removeFile test3 set f [open $path(test3) {WRONLY CREAT EXCL}] @@ -5273,18 +5270,14 @@ test io-40.10 {POSIX open access modes: RDONLY} { [list {two lines: this one} 1 \ [format "channel \"%s\" wasn't opened for writing" $f]] } 0 -test io-40.11 {POSIX open access modes: RDONLY} { +test io-40.11 {POSIX open access modes: RDONLY} -match regexp -body { removeFile test3 - set msg [list [catch {open $path(test3) RDONLY} msg] $msg] - regsub [file join {} $path(test3)] $msg "test3" msg - string tolower $msg -} {1 {couldn't open "test3": no such file or directory}} -test io-40.12 {POSIX open access modes: WRONLY} { + open $path(test3) RDONLY +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} +test io-40.12 {POSIX open access modes: WRONLY} -match regexp -body { removeFile test3 - set msg [list [catch {open $path(test3) WRONLY} msg] $msg] - regsub [file join {} $path(test3)] $msg "test3" msg - string tolower $msg -} {1 {couldn't open "test3": no such file or directory}} + open $path(test3) WRONLY +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.13 {POSIX open access modes: WRONLY} { makeFile xyzzy test3 set f [open $path(test3) WRONLY] @@ -5297,12 +5290,10 @@ test io-40.13 {POSIX open access modes: WRONLY} { string compare [string tolower $x] \ [list 1 "channel \"$f\" wasn't opened for reading" abzzy] } 0 -test io-40.14 {POSIX open access modes: RDWR} { +test io-40.14 {POSIX open access modes: RDWR} -match regexp -body { removeFile test3 - set msg [list [catch {open $path(test3) RDWR} msg] $msg] - regsub [file join {} $path(test3)] $msg "test3" msg - string tolower $msg -} {1 {couldn't open "test3": no such file or directory}} + open $path(test3) RDWR +} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory} test io-40.15 {POSIX open access modes: RDWR} { makeFile xyzzy test3 set f [open $path(test3) RDWR] |