summaryrefslogtreecommitdiffstats
path: root/tests/fileSystem.test
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2004-06-30 14:46:08 (GMT)
committervincentdarley <vincentdarley@noemail.net>2004-06-30 14:46:08 (GMT)
commit23b51361017bd25e02163f8062ebc85ad47c19d9 (patch)
tree5ff862c1655b4f624b6e4d6279d96b2542a356c0 /tests/fileSystem.test
parent8cfea59cdeb3a70bd15d7d28591b591956c06984 (diff)
downloadtcl-23b51361017bd25e02163f8062ebc85ad47c19d9.zip
tcl-23b51361017bd25e02163f8062ebc85ad47c19d9.tar.gz
tcl-23b51361017bd25e02163f8062ebc85ad47c19d9.tar.bz2
fix to trailing slash documentation and to a filesystem 'file join' bug on windows
FossilOrigin-Name: 3753a9000e4732a5ac7b59b0257c3f8509bc7142
Diffstat (limited to 'tests/fileSystem.test')
-rw-r--r--tests/fileSystem.test67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index 6ae080d..45fb97d 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -942,6 +942,73 @@ test filesystem-8.3 {path objects and empty string} {
lappend res $dst $yyy
} {foo foo {}}
+proc TestFind1 {d f} {
+ set r1 [file exists [file join $d $f]]
+ lappend res "[file join $d $f] found: $r1"
+ lappend res "is dir a dir? [file isdirectory $d]"
+ set r2 [file exists [file join $d $f]]
+ lappend res "[file join $d $f] found: $r2"
+ set res
+}
+proc TestFind2 {d f} {
+ set r1 [file exists [file join $d $f]]
+ lappend res "[file join $d $f] found: $r1"
+ lappend res "is dir a dir? [file isdirectory [file join $d]]"
+ set r2 [file exists [file join $d $f]]
+ lappend res "[file join $d $f] found: $r2"
+ set res
+}
+
+test filesystem-9.1 {path objects and join and object rep} {
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir [file join a b c]
+ set res [TestFind1 a [file join b . c]]
+ file delete -force [file join a b c]
+ cd $origdir
+ set res
+} {{a/b/./c found: 1} {is dir a dir? 1} {a/b/./c found: 1}}
+
+test filesystem-9.2 {path objects and join and object rep} {
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir [file join a b c]
+ set res [TestFind2 a [file join b . c]]
+ file delete -force [file join a b c]
+ cd $origdir
+ set res
+} {{a/b/./c found: 1} {is dir a dir? 1} {a/b/./c found: 1}}
+
+test filesystem-9.2.1 {path objects and join and object rep} {
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir [file join a b c]
+ set res [TestFind2 a [file join b .]]
+ file delete -force [file join a b c]
+ cd $origdir
+ set res
+} {{a/b/. found: 1} {is dir a dir? 1} {a/b/. found: 1}}
+
+test filesystem-9.3 {path objects and join and object rep} {
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir [file join a b c]
+ set res [TestFind1 a [file join b .. b c]]
+ file delete -force [file join a b c]
+ cd $origdir
+ set res
+} {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}}
+
+test filesystem-9.4 {path objects and join and object rep} {
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir [file join a b c]
+ set res [TestFind2 a [file join b .. b c]]
+ file delete -force [file join a b c]
+ cd $origdir
+ set res
+} {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}}
+
cleanupTests
unset -nocomplain drive
}