diff options
Diffstat (limited to 'tcl/tests/macFCmd.test')
-rw-r--r-- | tcl/tests/macFCmd.test | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/tcl/tests/macFCmd.test b/tcl/tests/macFCmd.test index afb1b51c26c..07360bed923 100644 --- a/tcl/tests/macFCmd.test +++ b/tcl/tests/macFCmd.test @@ -18,6 +18,11 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } +# These tests really need to be run from a writable directory, which +# it is assumed [temporaryDirectory] is. +set oldcwd [pwd] +cd [temporaryDirectory] + catch {file delete -force foo.dir} file mkdir foo.dir if {[catch {file attributes foo.dir -readonly 1}]} { @@ -32,13 +37,13 @@ file delete -force foo.dir test macFCmd-1.1 {GetFileFinderAttributes - no file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -creator} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-1.2 {GetFileFinderAttributes - creator} {macOnly} { catch {file delete -force foo.file} catch {close [open foo.file w]} - list [catch {file attributes foo.file -creator} msg] $msg \ - [file delete -force foo.file] -} {0 {MPW } {}} + list [catch {file attributes foo.file -creator} msg] \ + [regexp {MPW |CWIE} $msg] [file delete -force foo.file] +} {0 1 {}} test macFCmd-1.3 {GetFileFinderAttributes - type} {macOnly} { catch {file delete -force foo.file} catch {close [open foo.file w]} @@ -80,7 +85,7 @@ test macFCmd-1.8 {GetFileFinderAttributes - folder hidden} {macOnly} { test macFCmd-2.1 {GetFileReadOnly - bad file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -readonly} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-2.2 {GetFileReadOnly - file not read only} {macOnly} { catch {file delete -force foo.file} close [open foo.file w] @@ -111,7 +116,7 @@ test macFCmd-2.5 {GetFileReadOnly - directory read only} {macOnly fileSharing} { test macFCmd-3.1 {SetFileFinderAttributes - bad file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -creator FOOO} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-3.2 {SetFileFinderAttributes - creator} {macOnly} { catch {file delete -force foo.file} close [open foo.file w] @@ -147,12 +152,12 @@ test macFCmd-3.7 {SetFileFinderAttributes - directory} {macOnly} { file mkdir foo.dir list [catch {file attributes foo.dir -creator FOOO} msg] \ $msg [file delete -force foo.dir] -} {1 {cannot set -creator: ":foo.dir" is a directory} {}} +} {1 {cannot set -creator: "foo.dir" is a directory} {}} test macFCmd-4.1 {SetFileReadOnly - bad file} {macOnly} { catch {file delete -force foo.file} list [catch {file attributes foo.file -readonly 1} msg] $msg -} {1 {could not read ":foo.file": no such file or directory}} +} {1 {could not read "foo.file": no such file or directory}} test macFCmd-4.2 {SetFileReadOnly - file not readonly} {macOnly} { catch {file delete -force foo.file} close [open foo.file w] @@ -193,18 +198,6 @@ test macFCmd-4.7 {SetFileReadOnly - directory readonly} {macOnly notFileSharing} } {1 {cannot set a directory to read-only when File Sharing is turned off} {}} # cleanup +cd $oldcwd ::tcltest::cleanupTests return - - - - - - - - - - - - - |