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)
commitef6b0cfeabedafe5027e2a6ff6ca26d6f3c7d07a (patch)
tree1e37e4eeb9ff06d23c26fa4d7228b1b8073463c5 /tests
parenta84821a860443acb7f58429abc7bce7bacef661b (diff)
downloadtcl-ef6b0cfeabedafe5027e2a6ff6ca26d6f3c7d07a.zip
tcl-ef6b0cfeabedafe5027e2a6ff6ca26d6f3c7d07a.tar.gz
tcl-ef6b0cfeabedafe5027e2a6ff6ca26d6f3c7d07a.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