sl@0: # This file tests the filename manipulation routines. sl@0: # sl@0: # This file contains a collection of tests for one or more of the Tcl sl@0: # built-in commands. Sourcing this file into Tcl runs the tests and sl@0: # generates output for errors. No output means no errors were found. sl@0: # sl@0: # Copyright (c) 1995-1996 Sun Microsystems, Inc. sl@0: # Copyright (c) 1999 by Scriptics Corporation. sl@0: # Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiaries. All rights reserved. sl@0: # sl@0: # See the file "license.terms" for information on usage and redistribution sl@0: # of this file, and for a DISCLAIMER OF ALL WARRANTIES. sl@0: # sl@0: # RCS: @(#) $Id: fileName.test,v 1.30.2.7 2005/06/21 19:07:58 kennykb Exp $ sl@0: sl@0: if {[lsearch [namespace children] ::tcltest] == -1} { sl@0: package require tcltest sl@0: namespace import -force ::tcltest::* sl@0: } sl@0: sl@0: tcltest::testConstraint testsetplatform [string equal testsetplatform [info commands testsetplatform]] sl@0: tcltest::testConstraint testtranslatefilename [string equal testtranslatefilename [info commands testtranslatefilename]] sl@0: sl@0: global env sl@0: if {[tcltest::testConstraint testsetplatform]} { sl@0: set platform [testgetplatform] sl@0: } sl@0: sl@0: test filename-1.1 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype / sl@0: } absolute sl@0: test filename-1.2 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype /foo sl@0: } absolute sl@0: test filename-1.3 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype foo sl@0: } relative sl@0: test filename-1.4 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype c:/foo sl@0: } relative sl@0: test filename-1.5 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype ~ sl@0: } absolute sl@0: test filename-1.6 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype ~/foo sl@0: } absolute sl@0: test filename-1.7 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype ~foo sl@0: } absolute sl@0: test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file pathtype ./~foo sl@0: } relative sl@0: sl@0: test filename-2.1 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype / sl@0: } relative sl@0: test filename-2.2 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /. sl@0: } relative sl@0: test filename-2.3 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /.. sl@0: } relative sl@0: test filename-2.4 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype //.// sl@0: } relative sl@0: test filename-2.5 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype //.//../. sl@0: } relative sl@0: test filename-2.6 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~ sl@0: } absolute sl@0: test filename-2.7 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~: sl@0: } absolute sl@0: test filename-2.8 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~:foo sl@0: } absolute sl@0: test filename-2.9 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~/ sl@0: } absolute sl@0: test filename-2.10 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~/foo sl@0: } absolute sl@0: test filename-2.11 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /foo sl@0: } absolute sl@0: test filename-2.12 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /./foo sl@0: } absolute sl@0: test filename-2.13 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /..//./foo sl@0: } absolute sl@0: test filename-2.14 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /foo/bar sl@0: } absolute sl@0: test filename-2.15 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype foo/bar sl@0: } relative sl@0: test filename-2.16 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype : sl@0: } relative sl@0: test filename-2.17 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype :foo sl@0: } relative sl@0: test filename-2.18 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype foo: sl@0: } absolute sl@0: test filename-2.19 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype foo:bar sl@0: } absolute sl@0: test filename-2.20 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype :foo:bar sl@0: } relative sl@0: test filename-2.21 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ::foo:bar sl@0: } relative sl@0: test filename-2.22 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~foo sl@0: } absolute sl@0: test filename-2.23 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype :~foo sl@0: } relative sl@0: test filename-2.24 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype ~foo: sl@0: } absolute sl@0: test filename-2.25 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype foo/bar: sl@0: } absolute sl@0: test filename-2.26 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype /foo: sl@0: } absolute sl@0: test filename-2.27 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { sl@0: testsetplatform mac sl@0: file pathtype foo sl@0: } relative sl@0: sl@0: test filename-3.1 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype / sl@0: } volumerelative sl@0: test filename-3.2 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype \\ sl@0: } volumerelative sl@0: test filename-3.3 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype /foo sl@0: } volumerelative sl@0: test filename-3.4 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype \\foo sl@0: } volumerelative sl@0: test filename-3.5 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype c:/ sl@0: } absolute sl@0: test filename-3.6 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype c:\\ sl@0: } absolute sl@0: test filename-3.7 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype c:/foo sl@0: } absolute sl@0: test filename-3.8 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype c:\\foo sl@0: } absolute sl@0: test filename-3.9 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype c: sl@0: } volumerelative sl@0: test filename-3.10 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype c:foo sl@0: } volumerelative sl@0: test filename-3.11 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype foo sl@0: } relative sl@0: test filename-3.12 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype //foo/bar sl@0: } absolute sl@0: test filename-3.13 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype ~foo sl@0: } absolute sl@0: test filename-3.14 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype ~ sl@0: } absolute sl@0: test filename-3.15 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype ~/foo sl@0: } absolute sl@0: test filename-3.16 {Tcl_GetPathType: windows} {testsetplatform} { sl@0: testsetplatform windows sl@0: file pathtype ./~foo sl@0: } relative sl@0: sl@0: test filename-4.1 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split / sl@0: } {/} sl@0: test filename-4.2 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split /foo sl@0: } {/ foo} sl@0: test filename-4.3 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split /foo/bar sl@0: } {/ foo bar} sl@0: test filename-4.4 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split /foo/bar/baz sl@0: } {/ foo bar baz} sl@0: test filename-4.5 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split foo/bar sl@0: } {foo bar} sl@0: test filename-4.6 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ./foo/bar sl@0: } {. foo bar} sl@0: test filename-4.7 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split /foo/../././foo/bar sl@0: } {/ foo .. . . foo bar} sl@0: test filename-4.8 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ../foo/bar sl@0: } {.. foo bar} sl@0: test filename-4.9 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split {} sl@0: } {} sl@0: test filename-4.10 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split . sl@0: } {.} sl@0: test filename-4.11 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ../ sl@0: } {..} sl@0: test filename-4.12 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ../.. sl@0: } {.. ..} sl@0: test filename-4.13 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split //foo sl@0: } {/ foo} sl@0: test filename-4.14 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split foo//bar sl@0: } {foo bar} sl@0: test filename-4.15 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ~foo sl@0: } {~foo} sl@0: test filename-4.16 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ~foo/~bar sl@0: } {~foo ./~bar} sl@0: test filename-4.17 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split ~foo/~bar/~baz sl@0: } {~foo ./~bar ./~baz} sl@0: test filename-4.18 {Tcl_SplitPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file split foo/bar~/baz sl@0: } {foo bar~ baz} sl@0: sl@0: if {[tcltest::testConstraint testsetplatform]} { sl@0: testsetplatform $platform sl@0: } sl@0: sl@0: test filename-4.19 {Tcl_SplitPath} { sl@0: set oldDir [pwd] sl@0: set res [catch { sl@0: cd [temporaryDirectory] sl@0: file mkdir tildetmp sl@0: set nastydir [file join tildetmp ./~tilde] sl@0: file mkdir $nastydir sl@0: set norm [file normalize $nastydir] sl@0: cd tildetmp sl@0: cd ./~tilde sl@0: glob -nocomplain * sl@0: set idx [string first tildetmp $norm] sl@0: set norm [string range $norm $idx end] sl@0: # fix path away so all platforms are the same sl@0: regsub {(.*):$} $norm {\1} norm sl@0: regsub -all ":" $norm "/" norm sl@0: # make sure we can delete the directory we created sl@0: cd $oldDir sl@0: file delete -force $nastydir sl@0: set norm sl@0: } err] sl@0: cd $oldDir sl@0: catch {file delete -force [file join [temporaryDirectory] tildetmp]} sl@0: list $res $err sl@0: } {0 tildetmp/~tilde} sl@0: sl@0: test filename-5.1 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:b sl@0: } {a: b} sl@0: test filename-5.2 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:b:c sl@0: } {a: b c} sl@0: test filename-5.3 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:b:c: sl@0: } {a: b c} sl@0: test filename-5.4 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a: sl@0: } {a:} sl@0: test filename-5.5 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:: sl@0: } {a: ::} sl@0: test filename-5.6 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a::: sl@0: } {a: :: ::} sl@0: test filename-5.7 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split :a sl@0: } {a} sl@0: test filename-5.8 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split :a:: sl@0: } {a ::} sl@0: test filename-5.9 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split : sl@0: } {:} sl@0: test filename-5.10 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split :: sl@0: } {::} sl@0: test filename-5.11 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ::: sl@0: } {:: ::} sl@0: test filename-5.12 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:::b sl@0: } {a: :: :: b} sl@0: test filename-5.13 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /a:b sl@0: } {/a: b} sl@0: test filename-5.14 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~: sl@0: } {~:} sl@0: test filename-5.15 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~/: sl@0: } {~/:} sl@0: test filename-5.16 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~:foo sl@0: } {~: foo} sl@0: test filename-5.17 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~/foo sl@0: } {~: foo} sl@0: test filename-5.18 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~foo: sl@0: } {~foo:} sl@0: test filename-5.19 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:~foo sl@0: } {a: :~foo} sl@0: test filename-5.20 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split / sl@0: } {:/} sl@0: test filename-5.21 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a:b/c sl@0: } {a: :b/c} sl@0: test filename-5.22 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /foo sl@0: } {foo:} sl@0: test filename-5.23 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /a/b sl@0: } {a: b} sl@0: test filename-5.24 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /a/b/foo sl@0: } {a: b foo} sl@0: test filename-5.25 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a/b sl@0: } {a b} sl@0: test filename-5.26 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ./foo/bar sl@0: } {: foo bar} sl@0: test filename-5.27 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ../foo/bar sl@0: } {:: foo bar} sl@0: test filename-5.28 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split {} sl@0: } {} sl@0: test filename-5.29 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split . sl@0: } {:} sl@0: test filename-5.30 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ././ sl@0: } {: :} sl@0: test filename-5.31 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ././. sl@0: } {: : :} sl@0: test filename-5.32 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ../ sl@0: } {::} sl@0: test filename-5.33 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split .. sl@0: } {::} sl@0: test filename-5.34 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ../.. sl@0: } {:: ::} sl@0: test filename-5.35 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split //foo sl@0: } {foo:} sl@0: test filename-5.36 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split foo//bar sl@0: } {foo bar} sl@0: test filename-5.37 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~foo sl@0: } {~foo:} sl@0: test filename-5.38 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~ sl@0: } {~:} sl@0: test filename-5.39 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split foo sl@0: } {foo} sl@0: test filename-5.40 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~/ sl@0: } {~:} sl@0: test filename-5.41 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~foo/~bar sl@0: } {~foo: :~bar} sl@0: test filename-5.42 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split ~foo/~bar/~baz sl@0: } {~foo: :~bar :~baz} sl@0: test filename-5.43 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split foo/bar~/baz sl@0: } {foo bar~ baz} sl@0: test filename-5.44 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a/../b sl@0: } {a :: b} sl@0: test filename-5.45 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a/../../b sl@0: } {a :: :: b} sl@0: test filename-5.46 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split a/.././../b sl@0: } {a :: : :: b} sl@0: test filename-5.47 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /../bar sl@0: } {bar:} sl@0: test filename-5.48 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /./bar sl@0: } {bar:} sl@0: test filename-5.49 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split //.//.././bar sl@0: } {bar:} sl@0: test filename-5.50 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split /.. sl@0: } {:/..} sl@0: test filename-5.51 {Tcl_SplitPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file split //.//.././ sl@0: } {://.//.././} sl@0: sl@0: test filename-6.1 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split / sl@0: } {/} sl@0: test filename-6.2 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /foo sl@0: } {/ foo} sl@0: test filename-6.3 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /foo/bar sl@0: } {/ foo bar} sl@0: test filename-6.4 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /foo/bar/baz sl@0: } {/ foo bar baz} sl@0: test filename-6.5 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split foo/bar sl@0: } {foo bar} sl@0: test filename-6.6 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ./foo/bar sl@0: } {. foo bar} sl@0: test filename-6.7 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /foo/../././foo/bar sl@0: } {/ foo .. . . foo bar} sl@0: test filename-6.8 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ../foo/bar sl@0: } {.. foo bar} sl@0: test filename-6.9 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split {} sl@0: } {} sl@0: test filename-6.10 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split . sl@0: } {.} sl@0: test filename-6.11 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ../ sl@0: } {..} sl@0: test filename-6.12 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ../.. sl@0: } {.. ..} sl@0: test filename-6.13 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split //foo sl@0: } {/ foo} sl@0: test filename-6.14 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split foo//bar sl@0: } {foo bar} sl@0: test filename-6.15 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /\\/foo//bar sl@0: } {//foo/bar} sl@0: test filename-6.16 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /\\/foo//bar sl@0: } {//foo/bar} sl@0: test filename-6.17 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split /\\/foo//bar sl@0: } {//foo/bar} sl@0: test filename-6.18 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split \\\\foo\\bar sl@0: } {//foo/bar} sl@0: test filename-6.19 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split \\\\foo\\bar/baz sl@0: } {//foo/bar baz} sl@0: test filename-6.20 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c:/foo sl@0: } {c:/ foo} sl@0: test filename-6.21 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c:foo sl@0: } {c: foo} sl@0: test filename-6.22 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c: sl@0: } {c:} sl@0: test filename-6.23 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c:\\ sl@0: } {c:/} sl@0: test filename-6.24 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c:/ sl@0: } {c:/} sl@0: test filename-6.25 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c:/./.. sl@0: } {c:/ . ..} sl@0: test filename-6.26 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ~foo sl@0: } {~foo} sl@0: test filename-6.27 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ~foo/~bar sl@0: } {~foo ./~bar} sl@0: test filename-6.28 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split ~foo/~bar/~baz sl@0: } {~foo ./~bar ./~baz} sl@0: test filename-6.29 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split foo/bar~/baz sl@0: } {foo bar~ baz} sl@0: test filename-6.30 {Tcl_SplitPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file split c:~foo sl@0: } {c: ./~foo} sl@0: sl@0: test filename-7.1 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join / a sl@0: } {/a} sl@0: test filename-7.2 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join a b sl@0: } {a/b} sl@0: test filename-7.3 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join /a c /b d sl@0: } {/b/d} sl@0: test filename-7.4 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join / sl@0: } {/} sl@0: test filename-7.5 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join a sl@0: } {a} sl@0: test filename-7.6 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join {} sl@0: } {} sl@0: test filename-7.7 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join /a/ b sl@0: } {/a/b} sl@0: test filename-7.8 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join /a// b sl@0: } {/a/b} sl@0: test filename-7.9 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join /a/./../. b sl@0: } {/a/./.././b} sl@0: test filename-7.10 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join ~ a sl@0: } {~/a} sl@0: test filename-7.11 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join ~a ~b sl@0: } {~b} sl@0: test filename-7.12 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join ./~a b sl@0: } {./~a/b} sl@0: test filename-7.13 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join ./~a ~b sl@0: } {~b} sl@0: test filename-7.14 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join ./~a ./~b sl@0: } {./~a/~b} sl@0: test filename-7.15 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join a . b sl@0: } {a/./b} sl@0: test filename-7.16 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join a . ./~b sl@0: } {a/./~b} sl@0: test filename-7.17 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join //a b sl@0: } {/a/b} sl@0: test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: file join /// a b sl@0: } {/a/b} sl@0: sl@0: test filename-8.1 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a b sl@0: } {:a:b} sl@0: test filename-8.2 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join :a b sl@0: } {:a:b} sl@0: test filename-8.3 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a b: sl@0: } {b:} sl@0: test filename-8.4 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a: :b sl@0: } {a:b} sl@0: test filename-8.5 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a: :b: sl@0: } {a:b} sl@0: test filename-8.6 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a :: b sl@0: } {:a::b} sl@0: test filename-8.7 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a :: :: b sl@0: } {:a:::b} sl@0: test filename-8.8 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a ::: b sl@0: } {:a:::b} sl@0: test filename-8.9 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a: b: sl@0: } {b:} sl@0: test filename-8.10 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join /a/b sl@0: } {a:b} sl@0: test filename-8.11 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join /a/b c/d sl@0: } {a:b:c:d} sl@0: test filename-8.12 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join /a/b :c:d sl@0: } {a:b:c:d} sl@0: test filename-8.13 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join ~ foo sl@0: } {~:foo} sl@0: test filename-8.14 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join :: :: sl@0: } {:::} sl@0: test filename-8.15 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a: :: sl@0: } {a::} sl@0: test filename-8.16 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a {} b sl@0: } {:a:b} sl@0: test filename-8.17 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a::: b sl@0: } {a:::b} sl@0: test filename-8.18 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a : : : sl@0: } {:a} sl@0: test filename-8.19 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join : sl@0: } {:} sl@0: test filename-8.20 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join : a sl@0: } {:a} sl@0: test filename-8.21 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join a: :b/c sl@0: } {a:b/c} sl@0: test filename-8.22 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: file join :a :b/c sl@0: } {:a:b/c} sl@0: sl@0: test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join a b sl@0: } {a/b} sl@0: test filename-9.2 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join /a b sl@0: } {/a/b} sl@0: test filename-9.3 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join /a /b sl@0: } {/b} sl@0: test filename-9.4 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join c: foo sl@0: } {c:foo} sl@0: test filename-9.5 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join c:/ foo sl@0: } {c:/foo} sl@0: test filename-9.6 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join c:\\bar foo sl@0: } {c:/bar/foo} sl@0: test filename-9.7 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join /foo c:bar sl@0: } {c:bar} sl@0: test filename-9.8 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join ///host//share dir sl@0: } {//host/share/dir} sl@0: test filename-9.9 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join ~ foo sl@0: } {~/foo} sl@0: test filename-9.10 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join ~/~foo sl@0: } {~/~foo} sl@0: test filename-9.11 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join ~ ./~foo sl@0: } {~/~foo} sl@0: test filename-9.12 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join / ~foo sl@0: } {~foo} sl@0: test filename-9.13 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join ./a/ b c sl@0: } {./a/b/c} sl@0: test filename-9.14 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join ./~a/ b c sl@0: } {./~a/b/c} sl@0: test filename-9.15 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join // host share path sl@0: } {/host/share/path} sl@0: test filename-9.16 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join foo . bar sl@0: } {foo/./bar} sl@0: test filename-9.17 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join foo .. bar sl@0: } {foo/../bar} sl@0: test filename-9.18 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: file join foo/./bar sl@0: } {foo/./bar} sl@0: test filename-9.19 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: set res {} sl@0: lappend res \ sl@0: [file join {C:\foo\bar}] \ sl@0: [file join C:/blah {C:\foo\bar}] \ sl@0: [file join C:/blah C:/blah {C:\foo\bar}] sl@0: } {C:/foo/bar C:/foo/bar C:/foo/bar} sl@0: test filename-9.19.1 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: set res {} sl@0: lappend res \ sl@0: [file join {foo\bar}] \ sl@0: [file join C:/blah {foo\bar}] \ sl@0: [file join C:/blah C:/blah {foo\bar}] sl@0: } {foo/bar C:/blah/foo/bar C:/blah/foo/bar} sl@0: test filename-9.19.2 {Tcl_JoinPath: win} {testsetplatform winOnly} { sl@0: testsetplatform win sl@0: set res {} sl@0: lappend res \ sl@0: [file join {foo\bar}] \ sl@0: [file join [pwd] {foo\bar}] \ sl@0: [file join [pwd] [pwd] {foo\bar}] sl@0: string map [list [pwd] pwd] $res sl@0: } {foo/bar pwd/foo/bar pwd/foo/bar} sl@0: test filename-9.20 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: set res {} sl@0: lappend res \ sl@0: [file join {/foo/bar}] \ sl@0: [file join /x {/foo/bar}] \ sl@0: [file join /x /x {/foo/bar}] sl@0: } {/foo/bar /foo/bar /foo/bar} sl@0: test filename-9.21 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: set res {} sl@0: lappend res \ sl@0: [file join {/foo/bar}] \ sl@0: [file join drive: {/foo/bar}] \ sl@0: [file join drive: drive: {/foo/bar}] sl@0: } {foo:bar foo:bar foo:bar} sl@0: test filename-9.22 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: set res {} sl@0: lappend res \ sl@0: [file join {foo:bar}] \ sl@0: [file join drive: {foo:bar}] \ sl@0: [file join drive: drive: {foo:bar}] sl@0: } {foo:bar foo:bar foo:bar} sl@0: test filename-9.23 {Tcl_JoinPath: win} {testsetplatform} { sl@0: testsetplatform win sl@0: set res {} sl@0: lappend res \ sl@0: [file join {foo\bar}] \ sl@0: [file join C:/blah {foo\bar}] \ sl@0: [file join C:/blah C:/blah {foo\bar}] sl@0: string map [list C:/blah ""] $res sl@0: } {foo/bar /foo/bar /foo/bar} sl@0: test filename-9.24 {Tcl_JoinPath: unix} {testsetplatform} { sl@0: testsetplatform unix sl@0: set res {} sl@0: lappend res \ sl@0: [file join {foo/bar}] \ sl@0: [file join /x {foo/bar}] \ sl@0: [file join /x /x {foo/bar}] sl@0: string map [list /x ""] $res sl@0: } {foo/bar /foo/bar /foo/bar} sl@0: test filename-9.25 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: set res {} sl@0: lappend res \ sl@0: [file join {foo/bar}] \ sl@0: [file join drive: {foo/bar}] \ sl@0: [file join drive: drive: {foo/bar}] sl@0: string map [list drive: ""] $res sl@0: } {:foo:bar foo:bar foo:bar} sl@0: test filename-9.26 {Tcl_JoinPath: mac} {testsetplatform} { sl@0: testsetplatform mac sl@0: set res {} sl@0: lappend res \ sl@0: [file join {:foo:bar}] \ sl@0: [file join drive: {:foo:bar}] \ sl@0: [file join drive: drive: {:foo:bar}] sl@0: string map [list drive: ""] $res sl@0: } {:foo:bar foo:bar foo:bar} sl@0: sl@0: test filename-10.1 {Tcl_TranslateFileName} {testsetplatform} { sl@0: testsetplatform unix sl@0: list [catch {testtranslatefilename foo} msg] $msg sl@0: } {0 foo} sl@0: test filename-10.2 {Tcl_TranslateFileName} {testsetplatform} { sl@0: testsetplatform windows sl@0: list [catch {testtranslatefilename {c:/foo}} msg] $msg sl@0: } {0 {c:\foo}} sl@0: test filename-10.3 {Tcl_TranslateFileName} {testsetplatform} { sl@0: testsetplatform windows sl@0: list [catch {testtranslatefilename {c:/\\foo/}} msg] $msg sl@0: } {0 {c:\foo}} sl@0: test filename-10.4 {Tcl_TranslateFileName} {testsetplatform} { sl@0: testsetplatform mac sl@0: list [catch {testtranslatefilename foo} msg] $msg sl@0: } {0 :foo} sl@0: test filename-10.5 {Tcl_TranslateFileName} {testsetplatform} { sl@0: testsetplatform mac sl@0: list [catch {testtranslatefilename :~foo} msg] $msg sl@0: } {0 :~foo} sl@0: test filename-10.6 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "/home/test" sl@0: testsetplatform unix sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 /home/test/foo} sl@0: test filename-10.7 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: unset env(HOME) sl@0: testsetplatform unix sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {1 {couldn't find HOME environment variable to expand path}} sl@0: test filename-10.8 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "/home/test" sl@0: testsetplatform unix sl@0: set result [list [catch {testtranslatefilename ~} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 /home/test} sl@0: test filename-10.9 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "/home/test/" sl@0: testsetplatform unix sl@0: set result [list [catch {testtranslatefilename ~} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 /home/test} sl@0: test filename-10.10 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "/home/test/" sl@0: testsetplatform unix sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 /home/test/foo} sl@0: test filename-10.11 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "Root:" sl@0: testsetplatform mac sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 Root:foo} sl@0: test filename-10.12 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "Root:home" sl@0: testsetplatform mac sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 Root:home:foo} sl@0: test filename-10.13 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "Root:home" sl@0: testsetplatform mac sl@0: set result [list [catch {testtranslatefilename ~::foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 Root:home::foo} sl@0: test filename-10.14 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "Root:home" sl@0: testsetplatform mac sl@0: set result [list [catch {testtranslatefilename ~} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 Root:home} sl@0: test filename-10.15 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "Root:home:" sl@0: testsetplatform mac sl@0: set result [list [catch {testtranslatefilename ~::foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 Root:home::foo} sl@0: test filename-10.16 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "Root:home::" sl@0: testsetplatform mac sl@0: set result [list [catch {testtranslatefilename ~::foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 Root:home:::foo} sl@0: test filename-10.17 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "\\home\\" sl@0: testsetplatform windows sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 {\home\foo}} sl@0: test filename-10.18 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "\\home\\" sl@0: testsetplatform windows sl@0: set result [list [catch {testtranslatefilename ~/foo\\bar} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 {\home\foo\bar}} sl@0: test filename-10.19 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "c:" sl@0: testsetplatform windows sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 c:foo} sl@0: test filename-10.20 {Tcl_TranslateFileName} {testtranslatefilename} { sl@0: list [catch {testtranslatefilename ~blorp/foo} msg] $msg sl@0: } {1 {user "blorp" doesn't exist}} sl@0: test filename-10.21 {Tcl_TranslateFileName} {testsetplatform} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) "c:\\" sl@0: testsetplatform windows sl@0: set result [list [catch {testtranslatefilename ~/foo} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } {0 {c:\foo}} sl@0: test filename-10.22 {Tcl_TranslateFileName} {testsetplatform} { sl@0: testsetplatform windows sl@0: list [catch {testtranslatefilename foo//bar} msg] $msg sl@0: } {0 {foo\bar}} sl@0: sl@0: if {[tcltest::testConstraint testsetplatform]} { sl@0: testsetplatform $platform sl@0: } sl@0: sl@0: test filename-10.23 {Tcl_TranslateFileName} {unixOnly nonPortable} { sl@0: # this test fails if ~ouster is not /home/ouster sl@0: list [catch {testtranslatefilename ~ouster} msg] $msg sl@0: } {0 /home/ouster} sl@0: test filename-10.24 {Tcl_TranslateFileName} {unixOnly nonPortable} { sl@0: # this test fails if ~ouster is not /home/ouster sl@0: list [catch {testtranslatefilename ~ouster/foo} msg] $msg sl@0: } {0 /home/ouster/foo} sl@0: sl@0: sl@0: test filename-11.1 {Tcl_GlobCmd} { sl@0: list [catch {glob} msg] $msg sl@0: } {1 {wrong # args: should be "glob ?switches? name ?name ...?"}} sl@0: test filename-11.2 {Tcl_GlobCmd} { sl@0: list [catch {glob -gorp} msg] $msg sl@0: } {1 {bad option "-gorp": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}} sl@0: test filename-11.3 {Tcl_GlobCmd} { sl@0: list [catch {glob -nocomplai} msg] $msg sl@0: } {1 {wrong # args: should be "glob ?switches? name ?name ...?"}} sl@0: test filename-11.4 {Tcl_GlobCmd} { sl@0: list [catch {glob -nocomplain} msg] $msg sl@0: } {1 {wrong # args: should be "glob ?switches? name ?name ...?"}} sl@0: test filename-11.5 {Tcl_GlobCmd} { sl@0: list [catch {glob -nocomplain ~xyqrszzz} msg] $msg sl@0: } {0 {}} sl@0: test filename-11.6 {Tcl_GlobCmd} { sl@0: list [catch {glob ~xyqrszzz} msg] $msg sl@0: } {1 {user "xyqrszzz" doesn't exist}} sl@0: test filename-11.7 {Tcl_GlobCmd} { sl@0: list [catch {glob -- -nocomplain} msg] $msg sl@0: } {1 {no files matched glob pattern "-nocomplain"}} sl@0: test filename-11.8 {Tcl_GlobCmd} { sl@0: list [catch {glob -nocomplain -- -nocomplain} msg] $msg sl@0: } {0 {}} sl@0: test filename-11.9 {Tcl_GlobCmd} {testsetplatform} { sl@0: testsetplatform unix sl@0: list [catch {glob ~\\xyqrszzz/bar} msg] $msg sl@0: } {1 {user "\xyqrszzz" doesn't exist}} sl@0: test filename-11.10 {Tcl_GlobCmd} {testsetplatform} { sl@0: testsetplatform unix sl@0: list [catch {glob -nocomplain ~\\xyqrszzz/bar} msg] $msg sl@0: } {0 {}} sl@0: test filename-11.11 {Tcl_GlobCmd} {testsetplatform} { sl@0: testsetplatform unix sl@0: list [catch {glob ~xyqrszzz\\/\\bar} msg] $msg sl@0: } {1 {user "xyqrszzz" doesn't exist}} sl@0: test filename-11.12 {Tcl_GlobCmd} {testsetplatform} { sl@0: testsetplatform unix sl@0: set home $env(HOME) sl@0: unset env(HOME) sl@0: set x [list [catch {glob ~/*} msg] $msg] sl@0: set env(HOME) $home sl@0: set x sl@0: } {1 {couldn't find HOME environment variable to expand path}} sl@0: sl@0: if {[tcltest::testConstraint testsetplatform]} { sl@0: testsetplatform $platform sl@0: } sl@0: sl@0: test filename-11.13 {Tcl_GlobCmd} { sl@0: list [catch {file join [lindex [glob ~] 0]} msg] $msg sl@0: } [list 0 [file join $env(HOME)]] sl@0: sl@0: set oldpwd [pwd] sl@0: set oldhome $env(HOME) sl@0: cd [temporaryDirectory] sl@0: set env(HOME) [pwd] sl@0: file delete -force globTest sl@0: file mkdir globTest/a1/b1 sl@0: file mkdir globTest/a1/b2 sl@0: file mkdir globTest/a2/b3 sl@0: file mkdir globTest/a3 sl@0: close [open globTest/x1.c w] sl@0: close [open globTest/y1.c w] sl@0: close [open globTest/z1.c w] sl@0: close [open "globTest/weird name.c" w] sl@0: close [open globTest/a1/b1/x2.c w] sl@0: close [open globTest/a1/b2/y2.c w] sl@0: sl@0: catch {close [open globTest/.1 w]} sl@0: catch {close [open globTest/x,z1.c w]} sl@0: sl@0: test filename-11.14 {Tcl_GlobCmd} { sl@0: list [catch {glob ~/globTest} msg] $msg sl@0: } [list 0 [list [file join $env(HOME) globTest]]] sl@0: test filename-11.15 {Tcl_GlobCmd} { sl@0: list [catch {glob ~\\/globTest} msg] $msg sl@0: } [list 0 [list [file join $env(HOME) globTest]]] sl@0: test filename-11.16 {Tcl_GlobCmd} { sl@0: list [catch {glob globTest} msg] $msg sl@0: } {0 globTest} sl@0: sl@0: set globname "globTest" sl@0: set horribleglobname "glob\[\{Test" sl@0: sl@0: test filename-11.17 {Tcl_GlobCmd} {unixOnly} { sl@0: list [catch {lsort [glob -directory $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.17.1 {Tcl_GlobCmd} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -directory $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname .1]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: if {[string equal $tcl_platform(platform) "windows"]} { sl@0: if {[string index $tcl_platform(osVersion) 0] >= 5 \ sl@0: && ([lindex [file system [temporaryDirectory]] 1] == "NTFS")} { sl@0: tcltest::testConstraint linkDirectory 1 sl@0: } else { sl@0: tcltest::testConstraint linkDirectory 0 sl@0: } sl@0: } elseif {[string equal $tcl_platform(osSystemName) "Symbian"]} { sl@0: tcltest::testConstraint linkDirectory 0 sl@0: } else { sl@0: tcltest::testConstraint linkDirectory 1 sl@0: } sl@0: if {[string equal $tcl_platform(platform) "windows"] || [string equal $tcl_platform(osSystemName) "Symbian"]} { sl@0: tcltest::testConstraint symbolicLinkFile 0 sl@0: } else { sl@0: tcltest::testConstraint symbolicLinkFile 1 sl@0: } sl@0: test filename-11.17.2 {Tcl_GlobCmd} {notRoot linkDirectory} { sl@0: set dir [pwd] sl@0: set ret "error in test" sl@0: if {[catch { sl@0: cd $globname sl@0: file link -symbolic link a1 sl@0: cd $dir sl@0: set ret [list [catch { sl@0: lsort [glob -directory $globname -join * b1] sl@0: } msg] $msg] sl@0: }]} { sl@0: cd $dir sl@0: } sl@0: file delete [file join $globname link] sl@0: set ret sl@0: } [list 0 [lsort [list [file join $globname a1 b1] \ sl@0: [file join $globname link b1]]]] sl@0: # Simpler version of the above test to illustrate a given bug. sl@0: test filename-11.17.3 {Tcl_GlobCmd} {notRoot linkDirectory} { sl@0: set dir [pwd] sl@0: set ret "error in test" sl@0: if {[catch { sl@0: cd $globname sl@0: file link -symbolic link a1 sl@0: cd $dir sl@0: set ret [list [catch { sl@0: lsort [glob -directory $globname -type d *] sl@0: } msg] $msg] sl@0: }]} { sl@0: cd $dir sl@0: } sl@0: file delete [file join $globname link] sl@0: set ret sl@0: } [list 0 [lsort [list [file join $globname a1] \ sl@0: [file join $globname a2] \ sl@0: [file join $globname a3] \ sl@0: [file join $globname link]]]] sl@0: # Make sure the bugfix isn't too simple. We don't want sl@0: # to break 'glob -type l'. sl@0: test filename-11.17.4 {Tcl_GlobCmd} {notRoot linkDirectory} { sl@0: set dir [pwd] sl@0: set ret "error in test" sl@0: if {[catch { sl@0: cd $globname sl@0: file link -symbolic link a1 sl@0: cd $dir sl@0: set ret [list [catch { sl@0: lsort [glob -directory $globname -type l *] sl@0: } msg] $msg] sl@0: }]} { sl@0: cd $dir sl@0: } sl@0: file delete [file join $globname link] sl@0: set ret sl@0: } [list 0 [list [file join $globname link]]] sl@0: test filename-11.17.5 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -directory $globname -tails *.c]} msg] $msg sl@0: } [list 0 [lsort [list "weird name.c" x,z1.c x1.c y1.c z1.c]]] sl@0: test filename-11.17.6 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -directory $globname -tails *.c *.c]} msg] $msg sl@0: } [list 0 [lsort [concat [list "weird name.c" x,z1.c x1.c y1.c z1.c] \ sl@0: [list "weird name.c" x,z1.c x1.c y1.c z1.c]]]] sl@0: test filename-11.17.7 {Tcl_GlobCmd: broken link and glob -l} {linkDirectory} { sl@0: set dir [pwd] sl@0: set ret "error in test" sl@0: if {[catch { sl@0: cd $globname sl@0: file mkdir nonexistent sl@0: file link -symbolic link nonexistent sl@0: file delete nonexistent sl@0: cd $dir sl@0: set ret [list [catch { sl@0: lsort [glob -nocomplain -directory $globname -type l *] sl@0: } msg] $msg] sl@0: }]} { sl@0: cd $dir sl@0: } sl@0: file delete [file join $globname link] sl@0: set ret sl@0: } [list 0 [list [file join $globname link]]] sl@0: test filename-11.17.8 {Tcl_GlobCmd: broken link and glob -l} {symbolicLinkFile} { sl@0: set dir [pwd] sl@0: set ret "error in test" sl@0: if {[catch { sl@0: cd $globname sl@0: close [open "nonexistent" w] sl@0: file link -symbolic link nonexistent sl@0: file delete nonexistent sl@0: cd $dir sl@0: set ret [list [catch { sl@0: lsort [glob -nocomplain -directory $globname -type l *] sl@0: } msg] $msg] sl@0: }]} { sl@0: cd $dir sl@0: } sl@0: file delete [file join $globname link] sl@0: set ret sl@0: } [list 0 [list [file join $globname link]]] sl@0: test filename-11.18 {Tcl_GlobCmd} {unixOnly} { sl@0: list [catch {lsort [glob -path $globname/ *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.18.1 {Tcl_GlobCmd} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -path $globname/ *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname .1]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.19 {Tcl_GlobCmd} {unixOnly} { sl@0: list [catch {lsort [glob -join -path \ sl@0: [string range $globname 0 5] * *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.19.1 {Tcl_GlobCmd} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -join -path \ sl@0: [string range $globname 0 5] * *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname .1]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.20 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -type d -dir $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1]\ sl@0: [file join $globname a2]\ sl@0: [file join $globname a3]]]] sl@0: test filename-11.21 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -type d -path $globname *]} msg] $msg sl@0: } [list 0 [lsort [list $globname]]] sl@0: sl@0: test filename-11.21.1 {Tcl_GlobCmd} { sl@0: close [open {[tcl].testremains} w] sl@0: set res [list [catch {lsort [glob -path {[tcl]} *]} msg] $msg] sl@0: file delete -force {[tcl].testremains} sl@0: set res sl@0: } [list 0 {{[tcl].testremains}}] sl@0: sl@0: # Get rid of file/dir if it exists, since it will have sl@0: # been left behind by a previous failed run. sl@0: if {[file exists $horribleglobname]} { sl@0: file delete -force $horribleglobname sl@0: } sl@0: file rename globTest $horribleglobname sl@0: set globname $horribleglobname sl@0: sl@0: test filename-11.22 {Tcl_GlobCmd} {unixOnly} { sl@0: list [catch {lsort [glob -dir $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.22.1 {Tcl_GlobCmd} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -dir $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname .1]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.23 {Tcl_GlobCmd} {unixOnly} { sl@0: list [catch {lsort [glob -path $globname/ *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.23.1 {Tcl_GlobCmd} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -path $globname/ *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname .1]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.24 {Tcl_GlobCmd} {unixOnly} { sl@0: list [catch {lsort [glob -join -path \ sl@0: [string range $globname 0 5] * *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.24.1 {Tcl_GlobCmd} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -join -path \ sl@0: [string range $globname 0 5] * *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ sl@0: [file join $globname .1]\ sl@0: [file join $globname a3]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-11.25 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -type d -dir $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1]\ sl@0: [file join $globname a2]\ sl@0: [file join $globname a3]]]] sl@0: test filename-11.25.1 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -type {d r} -dir $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1]\ sl@0: [file join $globname a2]\ sl@0: [file join $globname a3]]]] sl@0: test filename-11.25.2 {Tcl_GlobCmd} { sl@0: list [catch {lsort [glob -type {d r w} -dir $globname *]} msg] $msg sl@0: } [list 0 [lsort [list [file join $globname a1]\ sl@0: [file join $globname a2]\ sl@0: [file join $globname a3]]]] sl@0: test filename-11.26 {Tcl_GlobCmd} { sl@0: list [catch {glob -type d -path $globname *} msg] $msg sl@0: } [list 0 [list $globname]] sl@0: test filename-11.27 {Tcl_GlobCmd} { sl@0: list [catch {glob -types abcde *} msg] $msg sl@0: } {1 {bad argument to "-types": abcde}} sl@0: test filename-11.28 {Tcl_GlobCmd} { sl@0: list [catch {glob -types z *} msg] $msg sl@0: } {1 {bad argument to "-types": z}} sl@0: test filename-11.29 {Tcl_GlobCmd} { sl@0: list [catch {glob -types {abcd efgh} *} msg] $msg sl@0: } {1 {only one MacOS type or creator argument to "-types" allowed}} sl@0: test filename-11.30 {Tcl_GlobCmd} { sl@0: list [catch {glob -types {{macintosh type TEXT} \ sl@0: {macintosh creator ALFA} efgh} *} msg] $msg sl@0: } {1 {only one MacOS type or creator argument to "-types" allowed}} sl@0: test filename-11.31 {Tcl_GlobCmd} { sl@0: list [catch {glob -types} msg] $msg sl@0: } {1 {missing argument to "-types"}} sl@0: test filename-11.32 {Tcl_GlobCmd} { sl@0: list [catch {glob -path hello -dir hello *} msg] $msg sl@0: } {1 {"-directory" cannot be used with "-path"}} sl@0: test filename-11.33 {Tcl_GlobCmd} { sl@0: list [catch {glob -path} msg] $msg sl@0: } {1 {missing argument to "-path"}} sl@0: test filename-11.34 {Tcl_GlobCmd} { sl@0: list [catch {glob -direct} msg] $msg sl@0: } {1 {missing argument to "-directory"}} sl@0: test filename-11.35 {Tcl_GlobCmd} { sl@0: list [catch {glob -paths *} msg] $msg sl@0: } {1 {bad option "-paths": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}} sl@0: # Test '-tails' flag to glob. sl@0: test filename-11.36 {Tcl_GlobCmd} { sl@0: list [catch {glob -tails *} msg] $msg sl@0: } {1 {"-tails" must be used with either "-directory" or "-path"}} sl@0: test filename-11.37 {Tcl_GlobCmd} { sl@0: list [catch {glob -type d -tails -path $globname *} msg] $msg sl@0: } [list 0 [list $globname]] sl@0: test filename-11.38 {Tcl_GlobCmd} { sl@0: list [catch {glob -tails -path $globname *} msg] $msg sl@0: } [list 0 [list $globname]] sl@0: test filename-11.39 {Tcl_GlobCmd} { sl@0: list [catch {glob -tails -join -path $globname *} msg] $msg sl@0: } [list 0 [list $globname]] sl@0: test filename-11.40 {Tcl_GlobCmd} { sl@0: expr {[glob -dir [pwd] -tails *] == [glob *]} sl@0: } {1} sl@0: test filename-11.41 {Tcl_GlobCmd} { sl@0: expr {[glob -dir [pwd] -tails *] != [glob -dir [pwd] *]} sl@0: } {1} sl@0: test filename-11.42 {Tcl_GlobCmd} { sl@0: set res [list] sl@0: foreach f [glob -dir [pwd] *] { sl@0: lappend res [file tail $f] sl@0: } sl@0: expr {$res == [glob *]} sl@0: } {1} sl@0: test filename-11.43 {Tcl_GlobCmd} { sl@0: list [catch {glob -t *} msg] $msg sl@0: } {1 {ambiguous option "-t": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}} sl@0: test filename-11.44 {Tcl_GlobCmd} { sl@0: list [catch {glob -tails -path hello -directory hello *} msg] $msg sl@0: } {1 {"-directory" cannot be used with "-path"}} sl@0: test filename-11.45 {Tcl_GlobCmd on root volume} { sl@0: set res1 "" sl@0: set res2 "" sl@0: catch { sl@0: set res1 [glob -dir [lindex [file volumes] 0] -tails *] sl@0: } sl@0: catch { sl@0: set tmpd [pwd] sl@0: cd [lindex [file volumes] 0] sl@0: set res2 [glob *] sl@0: cd $tmpd sl@0: } sl@0: expr {$res1 == $res2} sl@0: } {1} sl@0: test filename-11.46 {Tcl_GlobCmd} { sl@0: list [catch {glob -types abcde -dir foo *} msg] $msg sl@0: } {1 {bad argument to "-types": abcde}} sl@0: test filename-11.47 {Tcl_GlobCmd} { sl@0: list [catch {glob -types abcde -path foo *} msg] $msg sl@0: } {1 {bad argument to "-types": abcde}} sl@0: test filename-11.48 {Tcl_GlobCmd} { sl@0: list [catch {glob -types abcde -dir foo -join * *} msg] $msg sl@0: } {1 {bad argument to "-types": abcde}} sl@0: test filename-11.49 {Tcl_GlobCmd} { sl@0: list [catch {glob -types abcde -path foo -join * *} msg] $msg sl@0: } {1 {bad argument to "-types": abcde}} sl@0: sl@0: file rename $horribleglobname globTest sl@0: set globname globTest sl@0: unset horribleglobname sl@0: sl@0: test filename-12.1 {simple globbing} {unixOrPc} { sl@0: list [catch {glob {}} msg] $msg sl@0: } {0 .} sl@0: test filename-12.1.1 {simple globbing} {unixOrPc} { sl@0: list [catch {glob -types f {}} msg] $msg sl@0: } {1 {no files matched glob pattern ""}} sl@0: test filename-12.1.2 {simple globbing} {unixOrPc} { sl@0: list [catch {glob -types d {}} msg] $msg sl@0: } {0 .} sl@0: test filename-12.1.3 {simple globbing} {unixOnly} { sl@0: list [catch {glob -types hidden {}} msg] $msg sl@0: } {0 .} sl@0: test filename-12.1.4 {simple globbing} {pcOnly} { sl@0: list [catch {glob -types hidden {}} msg] $msg sl@0: } {1 {no files matched glob pattern ""}} sl@0: test filename-12.1.5 {simple globbing} {pcOnly} { sl@0: list [catch {glob -types hidden c:/} msg] $msg sl@0: } {1 {no files matched glob pattern "c:/"}} sl@0: test filename-12.1.6 {simple globbing} {pcOnly} { sl@0: list [catch {glob c:/} msg] $msg sl@0: } {0 c:/} sl@0: test filename-12.2 {simple globbing} {macOnly} { sl@0: list [catch {glob {}} msg] $msg sl@0: } {0 :} sl@0: test filename-12.2.1 {simple globbing} {macOnly} { sl@0: list [catch {glob -types f {}} msg] $msg sl@0: } {1 {no files matched glob pattern ""}} sl@0: test filename-12.2.2 {simple globbing} {macOnly} { sl@0: list [catch {glob -types d {}} msg] $msg sl@0: } {0 :} sl@0: test filename-12.2.3 {simple globbing} {macOnly} { sl@0: list [catch {glob -types hidden {}} msg] $msg sl@0: } {1 {no files matched glob pattern ""}} sl@0: test filename-12.3 {simple globbing} { sl@0: list [catch {glob -nocomplain \{a1,a2\}} msg] $msg sl@0: } {0 {}} sl@0: sl@0: if {$tcl_platform(platform) == "macintosh"} { sl@0: set globPreResult :globTest: sl@0: } else { sl@0: set globPreResult globTest/ sl@0: } sl@0: set x1 x1.c sl@0: set y1 y1.c sl@0: test filename-12.4 {simple globbing} {unixOrPc} { sl@0: lsort [glob globTest/x1.c globTest/y1.c globTest/foo] sl@0: } "$globPreResult$x1 $globPreResult$y1" sl@0: test filename-12.5 {simple globbing} { sl@0: list [catch {glob globTest\\/x1.c} msg] $msg sl@0: } "0 $globPreResult$x1" sl@0: test filename-12.6 {simple globbing} { sl@0: list [catch {glob globTest\\/\\x1.c} msg] $msg sl@0: } "0 $globPreResult$x1" sl@0: test filename-12.7 {globbing at filesystem root} {unixOnly} { sl@0: set res1 [glob -nocomplain /*] sl@0: set res2 [glob -path / *] sl@0: set equal [string equal $res1 $res2] sl@0: if {!$equal} { sl@0: lappend equal "not equal" $res1 $res2 sl@0: } sl@0: set equal sl@0: } {1} sl@0: test filename-12.8 {globbing at filesystem root} {unixOnly} { sl@0: set dir [lindex [glob -type d /*] 0] sl@0: set first [string range $dir 0 1] sl@0: set res1 [glob -nocomplain ${first}*] sl@0: set res2 [glob -path $first *] sl@0: set equal [string equal $res1 $res2] sl@0: if {!$equal} { sl@0: lappend equal "not equal" $res1 $res2 sl@0: } sl@0: set equal sl@0: } {1} sl@0: test filename-12.9 {globbing at filesystem root} {winOnly} { sl@0: # Can't grab just anything from 'file volumes' because we need a dir sl@0: # that has subdirs - assume that C:/ exists across Windows machines. sl@0: set dir [lindex [glob -type d C:/*] 0] sl@0: set first [string range $dir 0 3] sl@0: set res1 [glob -nocomplain ${first}*] sl@0: set res2 [glob -path $first *] sl@0: set equal [string equal $res1 $res2] sl@0: if {!$equal} { sl@0: lappend equal "not equal" $res1 $res2 sl@0: } sl@0: set equal sl@0: } {1} sl@0: sl@0: test filename-13.1 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{\}} msg] $msg sl@0: } "0 $globPreResult" sl@0: test filename-13.2 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{} msg] $msg sl@0: } {1 {unmatched open-brace in file name}} sl@0: test filename-13.3 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{\\\}} msg] $msg sl@0: } {1 {unmatched open-brace in file name}} sl@0: test filename-13.4 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{\\} msg] $msg sl@0: } {1 {unmatched open-brace in file name}} sl@0: test filename-13.5 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\}} msg] $msg sl@0: } {1 {unmatched close-brace in file name}} sl@0: test filename-13.6 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{\}x1.c} msg] $msg sl@0: } "0 $globPreResult$x1" sl@0: test filename-13.7 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{x\}1.c} msg] $msg sl@0: } "0 $globPreResult$x1" sl@0: test filename-13.8 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{x\{\}\}1.c} msg] $msg sl@0: } "0 $globPreResult$x1" sl@0: test filename-13.9 {globbing with brace substitution} { sl@0: list [lsort [catch {glob globTest/\{x,y\}1.c} msg]] $msg sl@0: } [list 0 [list $globPreResult$x1 $globPreResult$y1]] sl@0: test filename-13.10 {globbing with brace substitution} { sl@0: list [lsort [catch {glob globTest/\{x,,y\}1.c} msg]] $msg sl@0: } [list 0 [list $globPreResult$x1 $globPreResult$y1]] sl@0: test filename-13.11 {globbing with brace substitution} {unixOrPc} { sl@0: list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg sl@0: } {0 {globTest/x1.c globTest/x,z1.c globTest/z1.c}} sl@0: test filename-13.12 {globbing with brace substitution} {macOnly} { sl@0: list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg sl@0: } {0 {:globTest:x1.c :globTest:x,z1.c :globTest:z1.c}} sl@0: test filename-13.13 {globbing with brace substitution} { sl@0: lsort [glob globTest/{a,b,x,y}1.c] sl@0: } [list $globPreResult$x1 $globPreResult$y1] sl@0: test filename-13.14 {globbing with brace substitution} {unixOrPc} { sl@0: lsort [glob {globTest/{x1,y2,weird name}.c}] sl@0: } {{globTest/weird name.c} globTest/x1.c} sl@0: test filename-13.15 {globbing with brace substitution} {macOnly} { sl@0: lsort [glob {globTest/{x1,y2,weird name}.c}] sl@0: } {{:globTest:weird name.c} :globTest:x1.c} sl@0: test filename-13.16 {globbing with brace substitution} {unixOrPc} { sl@0: lsort [glob globTest/{x1.c,a1/*}] sl@0: } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} sl@0: test filename-13.17 {globbing with brace substitution} {macOnly} { sl@0: lsort [glob globTest/{x1.c,a1/*}] sl@0: } {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c} sl@0: test filename-13.18 {globbing with brace substitution} {unixOrPc} { sl@0: lsort [glob globTest/{x1.c,{a},a1/*}] sl@0: } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} sl@0: test filename-13.19 {globbing with brace substitution} {macOnly} { sl@0: lsort [glob globTest/{x1.c,{a},a1/*}] sl@0: } {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c} sl@0: test filename-13.20 {globbing with brace substitution} {unixOrPc} { sl@0: lsort [glob globTest/{a,x}1/*/{x,y}*] sl@0: } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} sl@0: test filename-13.21 {globbing with brace substitution} {macOnly} { sl@0: lsort [glob globTest/{a,x}1/*/{x,y}*] sl@0: } {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c} sl@0: test filename-13.22 {globbing with brace substitution} { sl@0: list [catch {glob globTest/\{a,x\}1/*/\{} msg] $msg sl@0: } {1 {unmatched open-brace in file name}} sl@0: sl@0: test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: lsort [glob glo*/*.c] sl@0: } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} sl@0: test filename-14.2 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob glo*/*.c] sl@0: } {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c} sl@0: test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: lsort [glob globTest/?1.c] sl@0: } {globTest/x1.c globTest/y1.c globTest/z1.c} sl@0: test filename-14.4 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob globTest/?1.c] sl@0: } {:globTest:x1.c :globTest:y1.c :globTest:z1.c} sl@0: sl@0: # The current directory could be anywhere; do this to stop spurious matches sl@0: file mkdir globTestContext sl@0: file rename globTest [file join globTestContext globTest] sl@0: set savepwd [pwd] sl@0: cd globTestContext sl@0: sl@0: test filename-14.5 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: lsort [glob */*/*/*.c] sl@0: } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} sl@0: test filename-14.6 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob */*/*/*.c] sl@0: } {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c} sl@0: sl@0: # Reset to where we were sl@0: cd $savepwd sl@0: file rename [file join globTestContext globTest] globTest sl@0: file delete globTestContext sl@0: sl@0: test filename-14.7 {asterisks, question marks, and brackets} {unixOnly} { sl@0: lsort [glob globTest/*] sl@0: } {globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} sl@0: test filename-14.7.1 {asterisks, question marks, and brackets} {pcOnly} { sl@0: lsort [glob globTest/*] sl@0: } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} sl@0: test filename-14.8 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob globTest/*] sl@0: } {:globTest:.1 :globTest:a1 :globTest:a2 :globTest:a3 {:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c} sl@0: test filename-14.9.1 {asterisks, question marks, and brackets} {unixOrPc tempNotSymbian} { sl@0: lsort [glob globTest/.*] sl@0: } {globTest/. globTest/.. globTest/.1} sl@0: test filename-14.9.2 {asterisks, question marks, and brackets} {symbianOnly} { sl@0: lsort [glob globTest/.*] sl@0: } {globTest/.1} sl@0: test filename-14.10 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob globTest/.*] sl@0: } {:globTest:.1} sl@0: test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: lsort [glob globTest/*/*] sl@0: } {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3} sl@0: test filename-14.12 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob globTest/*/*] sl@0: } {:globTest:a1:b1 :globTest:a1:b2 :globTest:a2:b3} sl@0: test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: lsort [glob {globTest/[xyab]1.*}] sl@0: } {globTest/x1.c globTest/y1.c} sl@0: test filename-14.14 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob {globTest/[xyab]1.*}] sl@0: } {:globTest:x1.c :globTest:y1.c} sl@0: test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: lsort [glob globTest/*/] sl@0: } {globTest/a1/ globTest/a2/ globTest/a3/} sl@0: test filename-14.16 {asterisks, question marks, and brackets} {macOnly} { sl@0: lsort [glob globTest/*/] sl@0: } {:globTest:a1: :globTest:a2: :globTest:a3:} sl@0: test filename-14.17 {asterisks, question marks, and brackets} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) [file join $env(HOME) globTest] sl@0: set result [list [catch {glob ~/z*} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } [list 0 [list [file join $env(HOME) globTest z1.c]]] sl@0: test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} { sl@0: list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg sl@0: } {0 {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}} sl@0: test filename-14.19 {asterisks, question marks, and brackets} {macOnly} { sl@0: list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg sl@0: } {0 {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c}} sl@0: test filename-14.20 {asterisks, question marks, and brackets} { sl@0: list [catch {glob -nocomplain goo/*} msg] $msg sl@0: } {0 {}} sl@0: test filename-14.21 {asterisks, question marks, and brackets} { sl@0: list [catch {glob globTest/*/gorp} msg] $msg sl@0: } {1 {no files matched glob pattern "globTest/*/gorp"}} sl@0: test filename-14.22 {asterisks, question marks, and brackets} { sl@0: list [catch {glob goo/* x*z foo?q} msg] $msg sl@0: } {1 {no files matched glob patterns "goo/* x*z foo?q"}} sl@0: test filename-14.23 {slash globbing} {unixOrPc} { sl@0: glob / sl@0: } / sl@0: test filename-14.24 {slash globbing} {pcOnly} { sl@0: glob {\\} sl@0: } / sl@0: test filename-14.25 {type specific globbing} {unixOnly} { sl@0: list [catch {lsort [glob -dir globTest -types f *]} msg] $msg sl@0: } [list 0 [lsort [list \ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-14.25.1 {type specific globbing} {pcOnly macOnly} { sl@0: list [catch {lsort [glob -dir globTest -types f *]} msg] $msg sl@0: } [list 0 [lsort [list \ sl@0: [file join $globname .1]\ sl@0: [file join $globname "weird name.c"]\ sl@0: [file join $globname x,z1.c]\ sl@0: [file join $globname x1.c]\ sl@0: [file join $globname y1.c] [file join $globname z1.c]]]] sl@0: test filename-14.26 {type specific globbing} { sl@0: list [catch {glob -nocomplain -dir globTest -types {readonly} *} msg] $msg sl@0: } [list 0 {}] sl@0: sl@0: unset globname sl@0: sl@0: # The following tests are only valid for Unix systems. sl@0: # On some systems, like AFS, "000" protection doesn't prevent sl@0: # access by owner, so the following test is not portable. sl@0: sl@0: catch {file attributes globTest/a1 -permissions 0000} sl@0: test filename-15.1 {unix specific globbing} {unixOnly nonPortable} { sl@0: string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode] sl@0: } {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}} sl@0: test filename-15.2 {unix specific no complain: no errors} {unixOnly nonPortable} { sl@0: glob -nocomplain globTest/a1/* sl@0: } {} sl@0: test filename-15.3 {unix specific no complain: no errors, good result} \ sl@0: {unixOnly nonPortable} { sl@0: # test fails because if an error occur , the interp's result sl@0: # is reset... sl@0: glob -nocomplain globTest/a2 globTest/a1/* globTest/a3 sl@0: } {globTest/a2 globTest/a3} sl@0: sl@0: catch {file attributes globTest/a1 -permissions 0755} sl@0: test filename-15.4 {unix specific no complain: no errors, good result} \ sl@0: {unixOnly nonPortable} { sl@0: # test fails because if an error occurs, the interp's result sl@0: # is reset... or you don't run at scriptics where the sl@0: # outser and welch users exists sl@0: glob -nocomplain ~ouster ~foo ~welch sl@0: } {/home/ouster /home/welch} sl@0: test filename-15.4.1 {no complain: no errors, good result} { sl@0: # test used to fail because if an error occurs, the interp's result sl@0: # is reset... sl@0: string equal [glob -nocomplain ~wontexist ~blah ~] \ sl@0: [glob -nocomplain ~ ~blah ~wontexist] sl@0: } {1} sl@0: test filename-15.5 {unix specific globbing} {unixOnly nonPortable} { sl@0: glob ~ouster/.csh* sl@0: } "/home/ouster/.cshrc" sl@0: catch {close [open globTest/odd\\\[\]*?\{\}name w]} sl@0: test filename-15.6 {unix specific globbing} {unixOnly tempNotSymbian} { sl@0: global env sl@0: set temp $env(HOME) sl@0: set env(HOME) $env(HOME)/globTest/odd\\\[\]*?\{\}name sl@0: set result [list [catch {glob ~} msg] $msg] sl@0: set env(HOME) $temp sl@0: set result sl@0: } [list 0 [list [lindex [glob ~] 0]/globTest/odd\\\[\]*?\{\}name]] sl@0: catch {file delete -force globTest/odd\\\[\]*?\{\}name} sl@0: sl@0: # The following tests are only valid for Windows systems. sl@0: set oldDir [pwd] sl@0: if {$::tcltest::testConstraints(pcOnly)} { sl@0: cd c:/ sl@0: file delete -force globTest sl@0: file mkdir globTest sl@0: close [open globTest/x1.BAT w] sl@0: close [open globTest/y1.Bat w] sl@0: close [open globTest/z1.bat w] sl@0: } sl@0: sl@0: test filename-16.1 {windows specific globbing} {pcOnly} { sl@0: lsort [glob globTest/*.bat] sl@0: } {globTest/x1.BAT globTest/y1.Bat globTest/z1.bat} sl@0: test filename-16.2 {windows specific globbing} {pcOnly} { sl@0: glob c: sl@0: } c: sl@0: test filename-16.3 {windows specific globbing} {pcOnly} { sl@0: glob c:\\\\ sl@0: } c:/ sl@0: test filename-16.4 {windows specific globbing} {pcOnly} { sl@0: glob c:/ sl@0: } c:/ sl@0: test filename-16.5 {windows specific globbing} {pcOnly} { sl@0: glob c:*bTest sl@0: } c:globTest sl@0: test filename-16.6 {windows specific globbing} {pcOnly} { sl@0: glob c:\\\\*bTest sl@0: } c:/globTest sl@0: test filename-16.7 {windows specific globbing} {pcOnly} { sl@0: glob c:/*bTest sl@0: } c:/globTest sl@0: test filename-16.8 {windows specific globbing} {pcOnly} { sl@0: lsort [glob c:globTest/*.bat] sl@0: } {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat} sl@0: test filename-16.9 {windows specific globbing} {pcOnly} { sl@0: lsort [glob c:/globTest/*.bat] sl@0: } {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat} sl@0: test filename-16.10 {windows specific globbing} {pcOnly} { sl@0: lsort [glob c:globTest\\\\*.bat] sl@0: } {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat} sl@0: test filename-16.11 {windows specific globbing} {pcOnly} { sl@0: lsort [glob c:\\\\globTest\\\\*.bat] sl@0: } {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat} sl@0: sl@0: # some tests require a shared C drive sl@0: sl@0: if {[catch {cd //[info hostname]/c}]} { sl@0: set ::tcltest::testConstraints(sharedCdrive) 0 sl@0: } else { sl@0: set ::tcltest::testConstraints(sharedCdrive) 1 sl@0: } sl@0: sl@0: test filename-16.12 {windows specific globbing} {pcOnly sharedCdrive} { sl@0: cd //[info hostname]/c sl@0: glob //[info hostname]/c/*Test sl@0: } //[info hostname]/c/globTest sl@0: test filename-16.13 {windows specific globbing} {pcOnly sharedCdrive} { sl@0: cd //[info hostname]/c sl@0: glob "\\\\\\\\[info hostname]\\\\c\\\\*Test" sl@0: } //[info hostname]/c/globTest sl@0: test filename-16.14 {windows specific globbing} {pcOnly} { sl@0: cd [lindex [glob -types d -dir C:/ *] 0] sl@0: expr {[lsearch -exact [glob {{.,*}*}] ".."] != -1} sl@0: } {1} sl@0: test filename-16.15 {windows specific globbing} {pcOnly} { sl@0: cd [lindex [glob -types d -dir C:/ *] 0] sl@0: glob .. sl@0: } {..} sl@0: test filename-16.16 {windows specific globbing} {pcOnly} { sl@0: file tail [lindex [glob "[lindex [glob -types d -dir C:/ *] 0]/.."] 0] sl@0: } {..} sl@0: sl@0: test filename-17.1 {windows specific special files} {testsetplatform} { sl@0: testsetplatform win sl@0: list [file pathtype com1] [file pathtype con] [file pathtype lpt3] \ sl@0: [file pathtype prn] [file pathtype nul] [file pathtype aux] \ sl@0: [file pathtype foo] sl@0: } {absolute absolute absolute absolute absolute absolute relative} sl@0: sl@0: test filename-17.2 {windows specific glob with executable} {winOnly} { sl@0: makeDirectory execglob sl@0: makeFile contents execglob/abc.exe sl@0: makeFile contents execglob/abc.notexecutable sl@0: set res [glob -nocomplain -dir [temporaryDirectory]/execglob \ sl@0: -tails -types x *] sl@0: removeFile execglob/abc.exe sl@0: removeFile execglob/abc.notexecutable sl@0: removeDirectory execglob sl@0: set res sl@0: } {abc.exe} sl@0: sl@0: test fileName-18.1 {windows - split ADS name correctly} {winOnly} { sl@0: # bug 1194458 sl@0: set x [file split c:/c:d] sl@0: set y [eval [linsert $x 0 file join]] sl@0: list $x $y sl@0: } {{c:/ ./c:d} c:/c:d} sl@0: sl@0: # cleanup sl@0: catch {file delete -force C:/globTest} sl@0: cd [temporaryDirectory] sl@0: file delete -force globTest sl@0: cd $oldpwd sl@0: set env(HOME) $oldhome sl@0: if {[tcltest::testConstraint testsetplatform]} { sl@0: testsetplatform $platform sl@0: catch {unset platform} sl@0: } sl@0: catch {unset oldhome temp result globPreResult} sl@0: ::tcltest::cleanupTests sl@0: return