Tcl Source Code

Artifact [5ba979fa2a]
Login

Artifact 5ba979fa2a110bc0fb922e9e23d21a44f575cfb5:

Attachment "fileName.diff.test" to ticket [451571ffff] added by vincentdarley 2001-08-22 17:56:28.
Index: fileName.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/fileName.test,v
retrieving revision 1.11
diff -U3 -r1.11 fileName.test
--- fileName.test	2001/07/31 19:12:07	1.11
+++ fileName.test	2001/08/22 10:49:54
@@ -1143,6 +1143,61 @@
 	[file join $globname x,z1.c]\
 	[file join $globname x1.c]\
 	[file join $globname y1.c] [file join $globname z1.c]]]]
+test filename-11.17.2 {Tcl_GlobCmd} {unixOnly notRoot} {
+    set dir [pwd]
+    set ret "error in test"
+    if {[catch {
+	cd $globname
+	exec ln -s a1 link
+	cd $dir
+	set ret [list [catch {
+	    lsort [glob -directory $globname -join * b1]
+	} msg] $msg]
+    }]} {
+	cd $dir
+    }
+    file delete [file join $globname link]
+    set ret
+} [list 0 [lsort [list [file join $globname a1 b1] \
+  [file join $globname link b1]]]]
+# Simpler version of the above test to illustrate a given bug.
+test filename-11.17.3 {Tcl_GlobCmd} {unixOnly notRoot} {
+    set dir [pwd]
+    set ret "error in test"
+    if {[catch {
+	cd $globname
+	exec ln -s a1 link
+	cd $dir
+	set ret [list [catch {
+	    lsort [glob -directory $globname -type d *]
+	} msg] $msg]
+    }]} {
+	cd $dir
+    }
+    file delete [file join $globname link]
+    set ret
+} [list 0 [lsort [list [file join $globname a1] \
+  [file join $globname a2] \
+  [file join $globname a3] \
+  [file join $globname link]]]]
+# Make sure the bugfix isn't too simple.  We don't want
+# to break 'glob -type l'.
+test filename-11.17.4 {Tcl_GlobCmd} {unixOnly notRoot} {
+    set dir [pwd]
+    set ret "error in test"
+    if {[catch {
+	cd $globname
+	exec ln -s a1 link
+	cd $dir
+	set ret [list [catch {
+	    lsort [glob -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]\