diff options
author | vincentdarley <vincentdarley> | 2004-07-02 16:52:17 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2004-07-02 16:52:17 (GMT) |
commit | 236570f0308763b7305fcff43431ac39f7e2d835 (patch) | |
tree | 03e96b9bdf3fa1670ff4ef064d46d27dd3d089c0 /tests | |
parent | 427b3847a04534c1a0703535fe306878274bcf20 (diff) | |
download | tcl-236570f0308763b7305fcff43431ac39f7e2d835.zip tcl-236570f0308763b7305fcff43431ac39f7e2d835.tar.gz tcl-236570f0308763b7305fcff43431ac39f7e2d835.tar.bz2 |
backport of recent fs fixes from cvs head
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fileSystem.test | 81 |
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 |