diff options
Diffstat (limited to 'tests/fCmd.test')
-rw-r--r-- | tests/fCmd.test | 78 |
1 files changed, 21 insertions, 57 deletions
diff --git a/tests/fCmd.test b/tests/fCmd.test index 9be033c..9e1b3e6 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fCmd.test,v 1.37 2004/01/26 13:33:59 vincentdarley Exp $ +# RCS: @(#) $Id: fCmd.test,v 1.38 2004/03/17 18:14:17 das Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -69,11 +69,7 @@ proc openup {path} { } proc cleanup {args} { - if {$::tcl_platform(platform) == "macintosh"} { - set wd [list :] - } else { - set wd [list .] - } + set wd [list .] foreach p [concat $wd $args] { set x "" catch { @@ -99,16 +95,6 @@ cd [temporaryDirectory] set ::tcltest::testConstraints(fileSharing) 0 set ::tcltest::testConstraints(notFileSharing) 1 -if {$tcl_platform(platform) == "macintosh"} { - catch {file delete -force foo.dir} - file mkdir foo.dir - if {[catch {file attributes foo.dir -readonly 1}] == 0} { - set ::tcltest::testConstraints(fileSharing) 1 - set ::tcltest::testConstraints(notFileSharing) 0 - } - file delete -force foo.dir -} - set ::tcltest::testConstraints(xdev) 0 if {$tcl_platform(platform) == "unix"} { @@ -300,10 +286,6 @@ test fCmd-4.11 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} \ testchmod 755 td1/td2 set msg } {1 {can't create directory "td1/td2/td3": permission denied}} -test fCmd-4.12 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} {macOnly} { - cleanup - list [catch {file mkdir nonexistentvolume:} msg] $msg -} {1 {can't create directory "nonexistentvolume:": invalid argument}} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} {notRoot} { cleanup set x [file exists td1] @@ -320,9 +302,6 @@ test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} \ file delete -force foo set result } {1 {can't create directory "foo/tf1": permission denied}} -test fCmd-4.15 {TclFileMakeDirsCmd: TclpCreateDirectory fails} {macOnly} { - list [catch {file mkdir ${root}:} msg] $msg -} [subst {1 {can't create directory "${root}:": no such file or directory}}] test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} {notRoot} { cleanup file mkdir tf1 @@ -439,11 +418,6 @@ test fCmd-6.7 {CopyRenameOneFile: errno != ENOENT} {pcOnly 95} { createfile tf1 list [catch {file rename tf1 $long} msg] $msg } [subst {1 {error renaming "tf1" to "$long": file name too long}}] -test fCmd-6.8 {CopyRenameOneFile: errno != ENOENT} {macOnly} { - cleanup - createfile tf1 - list [catch {file rename tf1 $long} msg] $msg -} [subst {1 {error renaming "tf1" to "$long": file name too long}}] test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} {unixOnly notRoot} { cleanup createfile tf1 @@ -767,20 +741,18 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} {notRoot testchmod} file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { testchmod 555 tds3 testchmod 555 tds4 } - if {$tcl_platform(platform) != "macintosh"} { - testchmod 555 [file join tdd2 tds2] - testchmod 555 [file join tdd4 tds4] - } + testchmod 555 [file join tdd2 tds2] + testchmod 555 [file join tdd4 tds4] set msg [list [catch {file rename td1 td2} msg] $msg] file rename -force tds1 tdd1 file rename -force tds2 tdd2 file rename -force tds3 tdd3 file rename -force tds4 tdd4 - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { set w3 [file writable [file join tdd3 tds3]] set w4 [file writable [file join tdd4 tds4]] } else { @@ -796,12 +768,12 @@ test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} {notRoot testch file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] file mkdir [file join tdd2 tds2 xxx] - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { testchmod 555 tds2 } set a1 [list [catch {file rename -force tds1 tdd1} msg] $msg] set a2 [list [catch {file rename -force tds2 tdd2} msg] $msg] - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { set w2 [file writable tds2] } else { set w2 0 @@ -824,12 +796,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te file mkdir td1 file mkdir td2 file mkdir td3 - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { testchmod 555 td2 } file rename td1 [file join td3 td3] file rename td2 [file join td3 td4] - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { set w4 [file writable [file join td3 td4]] } else { set w4 0 @@ -840,16 +812,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te test fCmd-9.12 {file rename: comprehensive: target exists} {notRoot testchmod} { cleanup file mkdir [file join td1 td2] [file join td2 td1] - if {$tcl_platform(platform) != "macintosh"} { - testchmod 555 [file join td2 td1] - } + testchmod 555 [file join td2 td1] file mkdir [file join td3 td4] [file join td4 td3] file rename -force td3 td4 set msg [list [file exists td3] [file exists [file join td4 td3 td4]] \ [catch {file rename td1 td2} msg] $msg] - if {$tcl_platform(platform) != "macintosh"} { - testchmod 755 [file join td2 td1] - } + testchmod 755 [file join td2 td1] set msg } [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file already exists}}] test fCmd-9.13 {file rename: comprehensive: can't overwrite target} {notRoot} { @@ -924,10 +892,8 @@ test fCmd-10.3 {file copy: comprehensive: dir to new name} {notRoot unixOrPc tes file copy td2 td4 set msg [list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4]] - if {$tcl_platform(platform) != "macintosh"} { - testchmod 755 td2 - testchmod 755 td4 - } + testchmod 755 td2 + testchmod 755 td4 set msg } [subst {{td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 0}] test fCmd-10.4 {file copy: comprehensive: file to existing file} {notRoot testchmod} { @@ -965,12 +931,10 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} {notRoot testchmod} file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] - if {$tcl_platform(platform) != "macintosh"} { - testchmod 555 tds3 - testchmod 555 tds4 - testchmod 555 [file join tdd2 tds2] - testchmod 555 [file join tdd4 tds4] - } + testchmod 555 tds3 + testchmod 555 tds4 + testchmod 555 [file join tdd2 tds2] + testchmod 555 [file join tdd4 tds4] set a1 [list [catch {file copy td1 td2} msg] $msg] set a2 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a3 [catch {file copy -force tds2 tdd2}] @@ -1678,7 +1642,7 @@ test fCmd-18.5 {TclFileRenameCmd: attempt to replace dir with non-dir} {notRoot} # # On Windows there is no easy way to determine if two files are the same # -test fCmd-18.6 {TclFileRenameCmd: rename a file to itself} {macOrUnix notRoot} { +test fCmd-18.6 {TclFileRenameCmd: rename a file to itself} {unixOnly notRoot} { catch {file delete -force -- tfa} set s [createfile tfa] set r1 [catch {file rename tfa tfa}] @@ -2020,7 +1984,7 @@ test fCmd-22.1 {TclpRenameFile: rename and overwrite in a single dir} {notRoot} set result } {1} -test fCmd-22.2 {TclpRenameFile: attempt to overwrite itself} {macOrUnix notRoot} { +test fCmd-22.2 {TclpRenameFile: attempt to overwrite itself} {unixOnly notRoot} { catch {file delete -force -- tfa1} set s [createfile tfa1] file rename -force tfa1 tfa1 @@ -2267,7 +2231,7 @@ test fCmd-28.5 {file link: source already exists} {linkDirectory} { set res } {1 {could not create new link "abc.dir": that path already exists}} -test fCmd-28.6 {file link: unsupported operation} {linkDirectory macOrWin} { +test fCmd-28.6 {file link: unsupported operation} {linkDirectory winOnly} { cd [temporaryDirectory] set res [list [catch {file link -hard abc.link abc.dir} msg] $msg] cd [workingDirectory] |