summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2001-09-04 18:06:34 (GMT)
committervincentdarley <vincentdarley>2001-09-04 18:06:34 (GMT)
commit6fca271a5115b8b8e94f10dce8efb41fcedb53a9 (patch)
treefe242e0e386c2472085adf41540fa813c334a000 /tests
parentbaf84f971d4274324372aab6f0fd968c63d7dcd4 (diff)
downloadtcl-6fca271a5115b8b8e94f10dce8efb41fcedb53a9.zip
tcl-6fca271a5115b8b8e94f10dce8efb41fcedb53a9.tar.gz
tcl-6fca271a5115b8b8e94f10dce8efb41fcedb53a9.tar.bz2
minor fs, vfs fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/fCmd.test21
-rw-r--r--tests/fileName.test5
-rw-r--r--tests/winFCmd.test29
3 files changed, 48 insertions, 7 deletions
diff --git a/tests/fCmd.test b/tests/fCmd.test
index c9e4ca0..9b3d997 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.10 2001/07/31 19:12:07 vincentdarley Exp $
+# RCS: @(#) $Id: fCmd.test,v 1.11 2001/09/04 18:06:34 vincentdarley Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -381,9 +381,26 @@ test fCmd-5.9 {TclFileDeleteCmd: is directory} {notRoot} {
} {0}
test fCmd-5.10 {TclFileDeleteCmd: TclpRemoveDirectory fails} {notRoot} {
cleanup
- file mkdir td1/td2
+ file mkdir [file join td1 td2]
list [catch {file delete td1} msg] $msg
} {1 {error deleting "td1": directory not empty}}
+test fCmd-5.11 {TclFileDeleteCmd: TclpRemoveDirectory with cwd inside} {notRoot} {
+ cleanup
+ set dir [pwd]
+ file mkdir [file join td1 td2]
+ cd [file join td1 td2]
+ set res [list [catch {file delete -force [file dirname [pwd]]} msg]]
+ cd $dir
+ lappend res [file exists td1] $msg
+} {0 0 {}}
+test fCmd-5.12 {TclFileDeleteCmd: TclpRemoveDirectory with bad perms} {unixOnly} {
+ cleanup
+ file mkdir [file join td1 td2]
+ #exec chmod u-rwx [file join td1 td2]
+ file attributes [file join td1 td2] -permissions u+rwx
+ set res [list [catch {file delete -force td1} msg]]
+ lappend res [file exists td1] $msg
+} {0 0 {}}
test fCmd-6.1 {CopyRenameOneFile: bad source} {notRoot} {
# can't test this, because it's caught by FileCopyRename
diff --git a/tests/fileName.test b/tests/fileName.test
index 5545cb1..92f0e30 100644
--- a/tests/fileName.test
+++ b/tests/fileName.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: fileName.test,v 1.13 2001/08/30 08:53:15 vincentdarley Exp $
+# RCS: @(#) $Id: fileName.test,v 1.14 2001/09/04 18:06:34 vincentdarley Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -318,10 +318,13 @@ test filename-4.19 {Tcl_SplitPath} {
set norm [string range $norm $idx end]
# fix path away so all platforms are the same
regsub -all ":" $norm "/" norm
+ # make sure we can delete the directory we created
+ cd $oldDir
file delete -force $nastydir
set norm
} err]
cd $oldDir
+ catch {file delete -force tildetmp}
list $res $err
} {0 tildetmp/~tilde}
diff --git a/tests/winFCmd.test b/tests/winFCmd.test
index 1e63666..d63a073 100644
--- a/tests/winFCmd.test
+++ b/tests/winFCmd.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: winFCmd.test,v 1.11 2001/08/30 08:53:15 vincentdarley Exp $
+# RCS: @(#) $Id: winFCmd.test,v 1.12 2001/09/04 18:06:34 vincentdarley Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -44,6 +44,15 @@ proc cleanup {args} {
}
}
+if {[string equal $tcl_platform(os) "Windows NT"] \
+ && [string equal [string index $tcl_platform(osVersion) 0] "5"]} {
+ tcltest::testConstraint win2000 1
+ tcltest::testConstraint notWin2000 0
+} else {
+ tcltest::testConstraint win2000 0
+ tcltest::testConstraint notWin2000 1
+}
+
set ::tcltest::testConstraints(cdrom) 0
set ::tcltest::testConstraints(exdev) 0
@@ -188,7 +197,11 @@ test winFCmd-1.12 {TclpRenameFile: errno: EACCES} {pcOnly} {
close $fd
set msg
} {1 EACCES}
-test winFCmd-1.13 {TclpRenameFile: errno: EACCES} {pcOnly} {
+test winFCmd-1.13 {TclpRenameFile: errno: EACCES} {win2000} {
+ cleanup
+ list [catch {testfile mv nul tf1} msg] $msg
+} {1 EINVAL}
+test winFCmd-1.13.1 {TclpRenameFile: errno: EACCES} {notWin2000} {
cleanup
list [catch {testfile mv nul tf1} msg] $msg
} {1 EACCES}
@@ -216,7 +229,11 @@ test winFCmd-1.18 {TclpRenameFile: srcAttr == -1} {pcOnly} {
cleanup
list [catch {testfile mv tf1 tf2} msg] $msg
} {1 ENOENT}
-test winFCmd-1.19 {TclpRenameFile: errno == EACCES} {pcOnly} {
+test winFCmd-1.19 {TclpRenameFile: errno == EACCES} {win2000} {
+ cleanup
+ list [catch {testfile mv nul tf1} msg] $msg
+} {1 EINVAL}
+test winFCmd-1.19.1 {TclpRenameFile: errno == EACCES} {notWin2000} {
cleanup
list [catch {testfile mv nul tf1} msg] $msg
} {1 EACCES}
@@ -361,7 +378,11 @@ test winFCmd-2.7 {TclpCopyFile: errno: EACCES} {95} {
close $fd
set msg
} {1 EACCES}
-test winFCmd-2.8 {TclpCopyFile: errno: EACCES} {nt} {
+test winFCmd-2.8 {TclpCopyFile: errno: EACCES} {win2000} {
+ cleanup
+ list [catch {testfile cp nul tf1} msg] $msg
+} {1 EINVAL}
+test winFCmd-2.8.1 {TclpCopyFile: errno: EACCES} {nt notWin2000} {
cleanup
list [catch {testfile cp nul tf1} msg] $msg
} {1 EACCES}