summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-12-02 18:48:12 (GMT)
committervincentdarley <vincentdarley>2004-12-02 18:48:12 (GMT)
commitc925812f1ceddc082fa4b68a7b7eec01943b7665 (patch)
tree1e37e4eeb9ff06d23c26fa4d7228b1b8073463c5 /tests
parentee09e2ee8f0a1bd37817887a65e62665902a0ffa (diff)
downloadtcl-c925812f1ceddc082fa4b68a7b7eec01943b7665.zip
tcl-c925812f1ceddc082fa4b68a7b7eec01943b7665.tar.gz
tcl-c925812f1ceddc082fa4b68a7b7eec01943b7665.tar.bz2
filesystem, glob, tilde fix
Diffstat (limited to 'tests')
-rw-r--r--tests/fileSystem.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index 20c04ae..f42e776 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -563,6 +563,58 @@ test filesystem-9.6 {path objects and file join and object rep} {winOnly} {
lappend res [file join $p toto]
} {C:/toto/toto C:/toto/toto}
+test filesystem-9.7 {path objects and glob and file tail and tilde} {
+ set res {}
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir tilde
+ close [open tilde/~testNotExist w]
+ cd tilde
+ set file [lindex [glob *test*] 0]
+ lappend res [file exists $file] [catch {file tail $file} r] $r
+ lappend res $file
+ lappend res [file exists $file] [catch {file tail $file} r] $r
+ lappend res [catch {file tail $file} r] $r
+ cd ..
+ file delete -force tilde
+ cd $origdir
+ set res
+} {0 1 {user "testNotExist" doesn't exist} ~testNotExist 0 1 {user "testNotExist" doesn't exist} 1 {user "testNotExist" doesn't exist}}
+test filesystem-9.8 {path objects and glob and file tail and tilde} {
+ set res {}
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir tilde
+ close [open tilde/~testNotExist w]
+ cd tilde
+ set file1 [lindex [glob *test*] 0]
+ set file2 "~testNotExist"
+ lappend res $file1 $file2
+ lappend res [catch {file tail $file1} r] $r
+ lappend res [catch {file tail $file2} r] $r
+ cd ..
+ file delete -force tilde
+ cd $origdir
+ set res
+} {~testNotExist ~testNotExist 1 {user "testNotExist" doesn't exist} 1 {user "testNotExist" doesn't exist}}
+test filesystem-9.9 {path objects and glob and file tail and tilde} {
+ set res {}
+ set origdir [pwd]
+ cd [tcltest::temporaryDirectory]
+ file mkdir tilde
+ close [open tilde/~testNotExist w]
+ cd tilde
+ set file1 [lindex [glob *test*] 0]
+ set file2 "~testNotExist"
+ lappend res [catch {file exists $file1} r] $r
+ lappend res [catch {file exists $file2} r] $r
+ lappend res [string equal $file1 $file2]
+ cd ..
+ file delete -force tilde
+ cd $origdir
+ set res
+} {0 0 0 0 1}
+
cleanupTests
}
namespace delete ::tcl::test::fileSystem