diff options
author | vincentdarley <vincentdarley> | 2004-12-02 18:49:21 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2004-12-02 18:49:21 (GMT) |
commit | e05bd52770456e6db2d99f2112bb78fae3619235 (patch) | |
tree | 81352b7f5a8f339ceca27e7930069261d4b1712e /tests/fileSystem.test | |
parent | daaaa7768cb634eed14f66460b8fdf6d85d719c1 (diff) | |
download | tcl-e05bd52770456e6db2d99f2112bb78fae3619235.zip tcl-e05bd52770456e6db2d99f2112bb78fae3619235.tar.gz tcl-e05bd52770456e6db2d99f2112bb78fae3619235.tar.bz2 |
filesystem, glob, tilde fix
Diffstat (limited to 'tests/fileSystem.test')
-rw-r--r-- | tests/fileSystem.test | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 17cc0dd..47526de 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -920,6 +920,57 @@ test filesystem-9.6 {path objects and file tail and object rep} {winOnly} { file isdirectory $p 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 unset -nocomplain drive |