diff options
author | vincentdarley <vincentdarley> | 2003-02-12 18:57:43 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-02-12 18:57:43 (GMT) |
commit | a7beeb8e861f0a22b48f42d0725bd6d1c9dc6f73 (patch) | |
tree | b100d4dd9bf3072e691813a756381ae21d9309ae /tests/fileName.test | |
parent | b05122813d01093b2b7448f1554203b7915f0905 (diff) | |
download | tcl-a7beeb8e861f0a22b48f42d0725bd6d1c9dc6f73.zip tcl-a7beeb8e861f0a22b48f42d0725bd6d1c9dc6f73.tar.gz tcl-a7beeb8e861f0a22b48f42d0725bd6d1c9dc6f73.tar.bz2 |
glob -l on broken symlink fix
Diffstat (limited to 'tests/fileName.test')
-rw-r--r-- | tests/fileName.test | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/fileName.test b/tests/fileName.test index 15bef4e..01b67ef 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fileName.test,v 1.29 2003/02/07 15:29:31 vincentdarley Exp $ +# RCS: @(#) $Id: fileName.test,v 1.30 2003/02/12 18:57:51 vincentdarley Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1185,6 +1185,11 @@ if {[string equal $tcl_platform(platform) "windows"]} { } else { tcltest::testConstraint linkDirectory 1 } +if {[string equal $tcl_platform(platform) "windows"]} { + tcltest::testConstraint symbolicLinkFile 0 +} else { + tcltest::testConstraint symbolicLinkFile 1 +} test filename-11.17.2 {Tcl_GlobCmd} {notRoot linkDirectory} { set dir [pwd] set ret "error in test" @@ -1247,6 +1252,42 @@ test filename-11.17.6 {Tcl_GlobCmd} { list [catch {lsort [glob -directory $globname -tails *.c *.c]} msg] $msg } [list 0 [lsort [concat [list "weird name.c" x,z1.c x1.c y1.c z1.c] \ [list "weird name.c" x,z1.c x1.c y1.c z1.c]]]] +test filename-11.17.7 {Tcl_GlobCmd: broken link and glob -l} {linkDirectory} { + set dir [pwd] + set ret "error in test" + if {[catch { + cd $globname + file mkdir nonexistent + file link -symbolic link nonexistent + file delete nonexistent + cd $dir + set ret [list [catch { + lsort [glob -nocomplain -directory $globname -type l *] + } msg] $msg] + }]} { + cd $dir + } + file delete [file join $globname link] + set ret +} [list 0 [list [file join $globname link]]] +test filename-11.17.8 {Tcl_GlobCmd: broken link and glob -l} {symbolicLinkFile} { + set dir [pwd] + set ret "error in test" + if {[catch { + cd $globname + close [open "nonexistent" w] + file link -symbolic link nonexistent + file delete nonexistent + cd $dir + set ret [list [catch { + lsort [glob -nocomplain -directory $globname -type l *] + } msg] $msg] + }]} { + cd $dir + } + file delete [file join $globname link] + set ret +} [list 0 [list [file join $globname link]]] test filename-11.18 {Tcl_GlobCmd} {unixOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ |