Attachment "ioCmd.test.patch" to
ticket [775394ffff]
added by
cleverly
2003-07-22 08:59:19.
--- tests/ioCmd.test 2003-02-19 09:43:30.000000000 -0700
+++ tests/ioCmd.test.fixed 2003-07-21 20:16:48.000000000 -0600
@@ -140,6 +140,10 @@
} {1 {can not find channel named "file107"} NONE}
set path(test3) [makeFile {} test3]
+# Test paths may contain characters which have special meaning to
+# the regexp engine (see SF bug #775394)
+set map {{[} {\[} \] {\]} ( {\(} ) {\)} + {\+} ? {\?} * {\*} \{ {\{}
+ \} {\}} ^ {\^} {$} {\$} \\ {\\}}
test iocmd-4.11 {read command} {
set f [open $path(test3) w]
@@ -393,13 +397,13 @@
test iocmd-12.2 {POSIX open access modes: RDONLY} {
removeFile test3
set msg [list [catch {open $path(test3) RDONLY} msg] $msg]
- regsub [file join {} $path(test3)] $msg "test3" msg
+ regsub [string map $map [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} {
removeFile test3
set msg [list [catch {open $path(test3) WRONLY} msg] $msg]
- regsub [file join {} $path(test3)] $msg "test3" msg
+ regsub [string map $map [file join {} $path(test3)]] $msg "test3" msg
string tolower $msg
} {1 {couldn't open "test3": no such file or directory}}
#
@@ -427,7 +431,7 @@
test iocmd-12.5 {POSIX open access modes: RDWR} {
removeFile test3
set msg [list [catch {open $path(test3) RDWR} msg] $msg]
- regsub [file join {} $path(test3)] $msg "test3" msg
+ regsub [string map $map [file join {} $path(test3)]] $msg "test3" msg
string tolower $msg
} {1 {couldn't open "test3": no such file or directory}}
test iocmd-12.6 {POSIX open access modes: errors} {