summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-10-07 14:55:48 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-10-07 14:55:48 (GMT)
commit39607280d269b07ad3246008d55e4fbe8f9b42ce (patch)
tree706364278e6d11999d9e35f4d0c72c7925b5e16b /tests
parentcc08946ddcd033c47f905e13d9be46cb1ef0b385 (diff)
downloadtcl-39607280d269b07ad3246008d55e4fbe8f9b42ce.zip
tcl-39607280d269b07ad3246008d55e4fbe8f9b42ce.tar.gz
tcl-39607280d269b07ad3246008d55e4fbe8f9b42ce.tar.bz2
* tests/io.test: Corrected several tests that failed when paths
* tests/ioCmd.test: included regexp-special chars. [Bug 775394]
Diffstat (limited to 'tests')
-rw-r--r--tests/io.test35
-rw-r--r--tests/ioCmd.test26
2 files changed, 23 insertions, 38 deletions
diff --git a/tests/io.test b/tests/io.test
index d74fa9d..7d39138 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.40 2003/02/25 22:03:38 andreas_kupries Exp $
+# RCS: @(#) $Id: io.test,v 1.40.2.1 2003/10/07 14:55:49 dgp Exp $
if {[catch {package require tcltest 2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2 required."
@@ -5217,16 +5217,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}]
@@ -5270,18 +5267,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]
@@ -5294,12 +5287,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]
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 9e721e7..a9b7ac6 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.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: ioCmd.test,v 1.16 2003/02/19 16:43:30 das Exp $
+# RCS: @(#) $Id: ioCmd.test,v 1.16.2.1 2003/10/07 14:55:49 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -390,18 +390,14 @@ test iocmd-12.1 {POSIX open access modes: RDONLY} {
string compare $x \
"{Two lines: this one} 1 [list [format "channel \"%s\" wasn't opened for writing" $f]]"
} 0
-test iocmd-12.2 {POSIX open access modes: RDONLY} {
+test iocmd-12.2 {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 iocmd-12.3 {POSIX open access modes: WRONLY} {
+ open $path(test3) RDONLY
+} -returnCodes error -result {(?i)couldn't open ".*test3": no such file or directory}
+test iocmd-12.3 {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 13.4 relies on assigning the same channel name twice.
#
@@ -424,12 +420,10 @@ test iocmd-12.4 {POSIX open access modes: WRONLY} {unixOnly} {
set y [list 1 [format "channel \"%s\" wasn't opened for reading" $f] abzzy]
string compare $x $y
} 0
-test iocmd-12.5 {POSIX open access modes: RDWR} {
+test iocmd-12.5 {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 iocmd-12.6 {POSIX open access modes: errors} {
concat [catch {open $path(test3) "FOO \{BAR BAZ"} msg] $msg\n$errorInfo
} "1 unmatched open brace in list