summaryrefslogtreecommitdiffstats
path: root/tests/fileSystem.test
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-06-30 14:46:08 (GMT)
committervincentdarley <vincentdarley>2004-06-30 14:46:08 (GMT)
commit40c4071e89f7108b6f3f15f4cc1f2534c76ba96e (patch)
tree5ff862c1655b4f624b6e4d6279d96b2542a356c0 /tests/fileSystem.test
parentc668fdda8808df7ea24f76d18d229b3fccd38dc8 (diff)
downloadtcl-40c4071e89f7108b6f3f15f4cc1f2534c76ba96e.zip
tcl-40c4071e89f7108b6f3f15f4cc1f2534c76ba96e.tar.gz
tcl-40c4071e89f7108b6f3f15f4cc1f2534c76ba96e.tar.bz2
fix to trailing slash documentation and to a filesystem 'file join' bug on windows
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
}