summaryrefslogtreecommitdiffstats
path: root/tests/fileSystem.test
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2004-07-02 16:52:16 (GMT)
committervincentdarley <vincentdarley@noemail.net>2004-07-02 16:52:16 (GMT)
commita75098683c5d8ae496859e75d9419f2712801925 (patch)
tree03e96b9bdf3fa1670ff4ef064d46d27dd3d089c0 /tests/fileSystem.test
parent4994748f4f783769195e53f0df615dbdacfdee54 (diff)
downloadtcl-a75098683c5d8ae496859e75d9419f2712801925.zip
tcl-a75098683c5d8ae496859e75d9419f2712801925.tar.gz
tcl-a75098683c5d8ae496859e75d9419f2712801925.tar.bz2
backport of recent fs fixes from cvs head
FossilOrigin-Name: 6611bc2f61cf372c6bd0018775fef4f803e7f1ce
Diffstat (limited to 'tests/fileSystem.test')
-rw-r--r--tests/fileSystem.test81
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index b934aed..7febfcd 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -473,6 +473,87 @@ 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 a
+ 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 a
+ 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 a
+ 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 a
+ 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 a
+ cd $origdir
+ set res
+} {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}}
+
+test filesystem-9.5 {path objects and file tail and object rep} {
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir dgp
+ close [open dgp/test w]
+ foreach relative [glob -nocomplain [file join * test]] {
+ set absolute [file join [pwd] $relative]
+ set res [list [file tail $absolute] "test"]
+ }
+ file delete -force dgp
+ cd $origdir
+ set res
+} {test test}
+
cleanupTests
}
namespace delete ::tcl::test::fileSystem