sl@0
|
1 |
# This file tests the filename manipulation routines.
|
sl@0
|
2 |
#
|
sl@0
|
3 |
# This file contains a collection of tests for one or more of the Tcl
|
sl@0
|
4 |
# built-in commands. Sourcing this file into Tcl runs the tests and
|
sl@0
|
5 |
# generates output for errors. No output means no errors were found.
|
sl@0
|
6 |
#
|
sl@0
|
7 |
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
sl@0
|
8 |
# Copyright (c) 1999 by Scriptics Corporation.
|
sl@0
|
9 |
# Portions Copyright (c) 2007 Nokia Corporation and/or its subsidiaries. All rights reserved.
|
sl@0
|
10 |
#
|
sl@0
|
11 |
# See the file "license.terms" for information on usage and redistribution
|
sl@0
|
12 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
sl@0
|
13 |
#
|
sl@0
|
14 |
# RCS: @(#) $Id: fileName.test,v 1.30.2.7 2005/06/21 19:07:58 kennykb Exp $
|
sl@0
|
15 |
|
sl@0
|
16 |
if {[lsearch [namespace children] ::tcltest] == -1} {
|
sl@0
|
17 |
package require tcltest
|
sl@0
|
18 |
namespace import -force ::tcltest::*
|
sl@0
|
19 |
}
|
sl@0
|
20 |
|
sl@0
|
21 |
tcltest::testConstraint testsetplatform [string equal testsetplatform [info commands testsetplatform]]
|
sl@0
|
22 |
tcltest::testConstraint testtranslatefilename [string equal testtranslatefilename [info commands testtranslatefilename]]
|
sl@0
|
23 |
|
sl@0
|
24 |
global env
|
sl@0
|
25 |
if {[tcltest::testConstraint testsetplatform]} {
|
sl@0
|
26 |
set platform [testgetplatform]
|
sl@0
|
27 |
}
|
sl@0
|
28 |
|
sl@0
|
29 |
test filename-1.1 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
30 |
testsetplatform unix
|
sl@0
|
31 |
file pathtype /
|
sl@0
|
32 |
} absolute
|
sl@0
|
33 |
test filename-1.2 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
34 |
testsetplatform unix
|
sl@0
|
35 |
file pathtype /foo
|
sl@0
|
36 |
} absolute
|
sl@0
|
37 |
test filename-1.3 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
38 |
testsetplatform unix
|
sl@0
|
39 |
file pathtype foo
|
sl@0
|
40 |
} relative
|
sl@0
|
41 |
test filename-1.4 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
42 |
testsetplatform unix
|
sl@0
|
43 |
file pathtype c:/foo
|
sl@0
|
44 |
} relative
|
sl@0
|
45 |
test filename-1.5 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
46 |
testsetplatform unix
|
sl@0
|
47 |
file pathtype ~
|
sl@0
|
48 |
} absolute
|
sl@0
|
49 |
test filename-1.6 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
50 |
testsetplatform unix
|
sl@0
|
51 |
file pathtype ~/foo
|
sl@0
|
52 |
} absolute
|
sl@0
|
53 |
test filename-1.7 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
54 |
testsetplatform unix
|
sl@0
|
55 |
file pathtype ~foo
|
sl@0
|
56 |
} absolute
|
sl@0
|
57 |
test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} {
|
sl@0
|
58 |
testsetplatform unix
|
sl@0
|
59 |
file pathtype ./~foo
|
sl@0
|
60 |
} relative
|
sl@0
|
61 |
|
sl@0
|
62 |
test filename-2.1 {Tcl_GetPathType: mac, denerate names} {testsetplatform} {
|
sl@0
|
63 |
testsetplatform mac
|
sl@0
|
64 |
file pathtype /
|
sl@0
|
65 |
} relative
|
sl@0
|
66 |
test filename-2.2 {Tcl_GetPathType: mac, denerate names} {testsetplatform} {
|
sl@0
|
67 |
testsetplatform mac
|
sl@0
|
68 |
file pathtype /.
|
sl@0
|
69 |
} relative
|
sl@0
|
70 |
test filename-2.3 {Tcl_GetPathType: mac, denerate names} {testsetplatform} {
|
sl@0
|
71 |
testsetplatform mac
|
sl@0
|
72 |
file pathtype /..
|
sl@0
|
73 |
} relative
|
sl@0
|
74 |
test filename-2.4 {Tcl_GetPathType: mac, denerate names} {testsetplatform} {
|
sl@0
|
75 |
testsetplatform mac
|
sl@0
|
76 |
file pathtype //.//
|
sl@0
|
77 |
} relative
|
sl@0
|
78 |
test filename-2.5 {Tcl_GetPathType: mac, denerate names} {testsetplatform} {
|
sl@0
|
79 |
testsetplatform mac
|
sl@0
|
80 |
file pathtype //.//../.
|
sl@0
|
81 |
} relative
|
sl@0
|
82 |
test filename-2.6 {Tcl_GetPathType: mac, tilde names} {testsetplatform} {
|
sl@0
|
83 |
testsetplatform mac
|
sl@0
|
84 |
file pathtype ~
|
sl@0
|
85 |
} absolute
|
sl@0
|
86 |
test filename-2.7 {Tcl_GetPathType: mac, tilde names} {testsetplatform} {
|
sl@0
|
87 |
testsetplatform mac
|
sl@0
|
88 |
file pathtype ~:
|
sl@0
|
89 |
} absolute
|
sl@0
|
90 |
test filename-2.8 {Tcl_GetPathType: mac, tilde names} {testsetplatform} {
|
sl@0
|
91 |
testsetplatform mac
|
sl@0
|
92 |
file pathtype ~:foo
|
sl@0
|
93 |
} absolute
|
sl@0
|
94 |
test filename-2.9 {Tcl_GetPathType: mac, tilde names} {testsetplatform} {
|
sl@0
|
95 |
testsetplatform mac
|
sl@0
|
96 |
file pathtype ~/
|
sl@0
|
97 |
} absolute
|
sl@0
|
98 |
test filename-2.10 {Tcl_GetPathType: mac, tilde names} {testsetplatform} {
|
sl@0
|
99 |
testsetplatform mac
|
sl@0
|
100 |
file pathtype ~/foo
|
sl@0
|
101 |
} absolute
|
sl@0
|
102 |
test filename-2.11 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} {
|
sl@0
|
103 |
testsetplatform mac
|
sl@0
|
104 |
file pathtype /foo
|
sl@0
|
105 |
} absolute
|
sl@0
|
106 |
test filename-2.12 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} {
|
sl@0
|
107 |
testsetplatform mac
|
sl@0
|
108 |
file pathtype /./foo
|
sl@0
|
109 |
} absolute
|
sl@0
|
110 |
test filename-2.13 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} {
|
sl@0
|
111 |
testsetplatform mac
|
sl@0
|
112 |
file pathtype /..//./foo
|
sl@0
|
113 |
} absolute
|
sl@0
|
114 |
test filename-2.14 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} {
|
sl@0
|
115 |
testsetplatform mac
|
sl@0
|
116 |
file pathtype /foo/bar
|
sl@0
|
117 |
} absolute
|
sl@0
|
118 |
test filename-2.15 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} {
|
sl@0
|
119 |
testsetplatform mac
|
sl@0
|
120 |
file pathtype foo/bar
|
sl@0
|
121 |
} relative
|
sl@0
|
122 |
test filename-2.16 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
123 |
testsetplatform mac
|
sl@0
|
124 |
file pathtype :
|
sl@0
|
125 |
} relative
|
sl@0
|
126 |
test filename-2.17 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
127 |
testsetplatform mac
|
sl@0
|
128 |
file pathtype :foo
|
sl@0
|
129 |
} relative
|
sl@0
|
130 |
test filename-2.18 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
131 |
testsetplatform mac
|
sl@0
|
132 |
file pathtype foo:
|
sl@0
|
133 |
} absolute
|
sl@0
|
134 |
test filename-2.19 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
135 |
testsetplatform mac
|
sl@0
|
136 |
file pathtype foo:bar
|
sl@0
|
137 |
} absolute
|
sl@0
|
138 |
test filename-2.20 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
139 |
testsetplatform mac
|
sl@0
|
140 |
file pathtype :foo:bar
|
sl@0
|
141 |
} relative
|
sl@0
|
142 |
test filename-2.21 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
143 |
testsetplatform mac
|
sl@0
|
144 |
file pathtype ::foo:bar
|
sl@0
|
145 |
} relative
|
sl@0
|
146 |
test filename-2.22 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
147 |
testsetplatform mac
|
sl@0
|
148 |
file pathtype ~foo
|
sl@0
|
149 |
} absolute
|
sl@0
|
150 |
test filename-2.23 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
151 |
testsetplatform mac
|
sl@0
|
152 |
file pathtype :~foo
|
sl@0
|
153 |
} relative
|
sl@0
|
154 |
test filename-2.24 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
155 |
testsetplatform mac
|
sl@0
|
156 |
file pathtype ~foo:
|
sl@0
|
157 |
} absolute
|
sl@0
|
158 |
test filename-2.25 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
159 |
testsetplatform mac
|
sl@0
|
160 |
file pathtype foo/bar:
|
sl@0
|
161 |
} absolute
|
sl@0
|
162 |
test filename-2.26 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
163 |
testsetplatform mac
|
sl@0
|
164 |
file pathtype /foo:
|
sl@0
|
165 |
} absolute
|
sl@0
|
166 |
test filename-2.27 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} {
|
sl@0
|
167 |
testsetplatform mac
|
sl@0
|
168 |
file pathtype foo
|
sl@0
|
169 |
} relative
|
sl@0
|
170 |
|
sl@0
|
171 |
test filename-3.1 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
172 |
testsetplatform windows
|
sl@0
|
173 |
file pathtype /
|
sl@0
|
174 |
} volumerelative
|
sl@0
|
175 |
test filename-3.2 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
176 |
testsetplatform windows
|
sl@0
|
177 |
file pathtype \\
|
sl@0
|
178 |
} volumerelative
|
sl@0
|
179 |
test filename-3.3 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
180 |
testsetplatform windows
|
sl@0
|
181 |
file pathtype /foo
|
sl@0
|
182 |
} volumerelative
|
sl@0
|
183 |
test filename-3.4 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
184 |
testsetplatform windows
|
sl@0
|
185 |
file pathtype \\foo
|
sl@0
|
186 |
} volumerelative
|
sl@0
|
187 |
test filename-3.5 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
188 |
testsetplatform windows
|
sl@0
|
189 |
file pathtype c:/
|
sl@0
|
190 |
} absolute
|
sl@0
|
191 |
test filename-3.6 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
192 |
testsetplatform windows
|
sl@0
|
193 |
file pathtype c:\\
|
sl@0
|
194 |
} absolute
|
sl@0
|
195 |
test filename-3.7 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
196 |
testsetplatform windows
|
sl@0
|
197 |
file pathtype c:/foo
|
sl@0
|
198 |
} absolute
|
sl@0
|
199 |
test filename-3.8 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
200 |
testsetplatform windows
|
sl@0
|
201 |
file pathtype c:\\foo
|
sl@0
|
202 |
} absolute
|
sl@0
|
203 |
test filename-3.9 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
204 |
testsetplatform windows
|
sl@0
|
205 |
file pathtype c:
|
sl@0
|
206 |
} volumerelative
|
sl@0
|
207 |
test filename-3.10 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
208 |
testsetplatform windows
|
sl@0
|
209 |
file pathtype c:foo
|
sl@0
|
210 |
} volumerelative
|
sl@0
|
211 |
test filename-3.11 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
212 |
testsetplatform windows
|
sl@0
|
213 |
file pathtype foo
|
sl@0
|
214 |
} relative
|
sl@0
|
215 |
test filename-3.12 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
216 |
testsetplatform windows
|
sl@0
|
217 |
file pathtype //foo/bar
|
sl@0
|
218 |
} absolute
|
sl@0
|
219 |
test filename-3.13 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
220 |
testsetplatform windows
|
sl@0
|
221 |
file pathtype ~foo
|
sl@0
|
222 |
} absolute
|
sl@0
|
223 |
test filename-3.14 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
224 |
testsetplatform windows
|
sl@0
|
225 |
file pathtype ~
|
sl@0
|
226 |
} absolute
|
sl@0
|
227 |
test filename-3.15 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
228 |
testsetplatform windows
|
sl@0
|
229 |
file pathtype ~/foo
|
sl@0
|
230 |
} absolute
|
sl@0
|
231 |
test filename-3.16 {Tcl_GetPathType: windows} {testsetplatform} {
|
sl@0
|
232 |
testsetplatform windows
|
sl@0
|
233 |
file pathtype ./~foo
|
sl@0
|
234 |
} relative
|
sl@0
|
235 |
|
sl@0
|
236 |
test filename-4.1 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
237 |
testsetplatform unix
|
sl@0
|
238 |
file split /
|
sl@0
|
239 |
} {/}
|
sl@0
|
240 |
test filename-4.2 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
241 |
testsetplatform unix
|
sl@0
|
242 |
file split /foo
|
sl@0
|
243 |
} {/ foo}
|
sl@0
|
244 |
test filename-4.3 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
245 |
testsetplatform unix
|
sl@0
|
246 |
file split /foo/bar
|
sl@0
|
247 |
} {/ foo bar}
|
sl@0
|
248 |
test filename-4.4 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
249 |
testsetplatform unix
|
sl@0
|
250 |
file split /foo/bar/baz
|
sl@0
|
251 |
} {/ foo bar baz}
|
sl@0
|
252 |
test filename-4.5 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
253 |
testsetplatform unix
|
sl@0
|
254 |
file split foo/bar
|
sl@0
|
255 |
} {foo bar}
|
sl@0
|
256 |
test filename-4.6 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
257 |
testsetplatform unix
|
sl@0
|
258 |
file split ./foo/bar
|
sl@0
|
259 |
} {. foo bar}
|
sl@0
|
260 |
test filename-4.7 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
261 |
testsetplatform unix
|
sl@0
|
262 |
file split /foo/../././foo/bar
|
sl@0
|
263 |
} {/ foo .. . . foo bar}
|
sl@0
|
264 |
test filename-4.8 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
265 |
testsetplatform unix
|
sl@0
|
266 |
file split ../foo/bar
|
sl@0
|
267 |
} {.. foo bar}
|
sl@0
|
268 |
test filename-4.9 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
269 |
testsetplatform unix
|
sl@0
|
270 |
file split {}
|
sl@0
|
271 |
} {}
|
sl@0
|
272 |
test filename-4.10 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
273 |
testsetplatform unix
|
sl@0
|
274 |
file split .
|
sl@0
|
275 |
} {.}
|
sl@0
|
276 |
test filename-4.11 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
277 |
testsetplatform unix
|
sl@0
|
278 |
file split ../
|
sl@0
|
279 |
} {..}
|
sl@0
|
280 |
test filename-4.12 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
281 |
testsetplatform unix
|
sl@0
|
282 |
file split ../..
|
sl@0
|
283 |
} {.. ..}
|
sl@0
|
284 |
test filename-4.13 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
285 |
testsetplatform unix
|
sl@0
|
286 |
file split //foo
|
sl@0
|
287 |
} {/ foo}
|
sl@0
|
288 |
test filename-4.14 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
289 |
testsetplatform unix
|
sl@0
|
290 |
file split foo//bar
|
sl@0
|
291 |
} {foo bar}
|
sl@0
|
292 |
test filename-4.15 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
293 |
testsetplatform unix
|
sl@0
|
294 |
file split ~foo
|
sl@0
|
295 |
} {~foo}
|
sl@0
|
296 |
test filename-4.16 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
297 |
testsetplatform unix
|
sl@0
|
298 |
file split ~foo/~bar
|
sl@0
|
299 |
} {~foo ./~bar}
|
sl@0
|
300 |
test filename-4.17 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
301 |
testsetplatform unix
|
sl@0
|
302 |
file split ~foo/~bar/~baz
|
sl@0
|
303 |
} {~foo ./~bar ./~baz}
|
sl@0
|
304 |
test filename-4.18 {Tcl_SplitPath: unix} {testsetplatform} {
|
sl@0
|
305 |
testsetplatform unix
|
sl@0
|
306 |
file split foo/bar~/baz
|
sl@0
|
307 |
} {foo bar~ baz}
|
sl@0
|
308 |
|
sl@0
|
309 |
if {[tcltest::testConstraint testsetplatform]} {
|
sl@0
|
310 |
testsetplatform $platform
|
sl@0
|
311 |
}
|
sl@0
|
312 |
|
sl@0
|
313 |
test filename-4.19 {Tcl_SplitPath} {
|
sl@0
|
314 |
set oldDir [pwd]
|
sl@0
|
315 |
set res [catch {
|
sl@0
|
316 |
cd [temporaryDirectory]
|
sl@0
|
317 |
file mkdir tildetmp
|
sl@0
|
318 |
set nastydir [file join tildetmp ./~tilde]
|
sl@0
|
319 |
file mkdir $nastydir
|
sl@0
|
320 |
set norm [file normalize $nastydir]
|
sl@0
|
321 |
cd tildetmp
|
sl@0
|
322 |
cd ./~tilde
|
sl@0
|
323 |
glob -nocomplain *
|
sl@0
|
324 |
set idx [string first tildetmp $norm]
|
sl@0
|
325 |
set norm [string range $norm $idx end]
|
sl@0
|
326 |
# fix path away so all platforms are the same
|
sl@0
|
327 |
regsub {(.*):$} $norm {\1} norm
|
sl@0
|
328 |
regsub -all ":" $norm "/" norm
|
sl@0
|
329 |
# make sure we can delete the directory we created
|
sl@0
|
330 |
cd $oldDir
|
sl@0
|
331 |
file delete -force $nastydir
|
sl@0
|
332 |
set norm
|
sl@0
|
333 |
} err]
|
sl@0
|
334 |
cd $oldDir
|
sl@0
|
335 |
catch {file delete -force [file join [temporaryDirectory] tildetmp]}
|
sl@0
|
336 |
list $res $err
|
sl@0
|
337 |
} {0 tildetmp/~tilde}
|
sl@0
|
338 |
|
sl@0
|
339 |
test filename-5.1 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
340 |
testsetplatform mac
|
sl@0
|
341 |
file split a:b
|
sl@0
|
342 |
} {a: b}
|
sl@0
|
343 |
test filename-5.2 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
344 |
testsetplatform mac
|
sl@0
|
345 |
file split a:b:c
|
sl@0
|
346 |
} {a: b c}
|
sl@0
|
347 |
test filename-5.3 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
348 |
testsetplatform mac
|
sl@0
|
349 |
file split a:b:c:
|
sl@0
|
350 |
} {a: b c}
|
sl@0
|
351 |
test filename-5.4 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
352 |
testsetplatform mac
|
sl@0
|
353 |
file split a:
|
sl@0
|
354 |
} {a:}
|
sl@0
|
355 |
test filename-5.5 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
356 |
testsetplatform mac
|
sl@0
|
357 |
file split a::
|
sl@0
|
358 |
} {a: ::}
|
sl@0
|
359 |
test filename-5.6 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
360 |
testsetplatform mac
|
sl@0
|
361 |
file split a:::
|
sl@0
|
362 |
} {a: :: ::}
|
sl@0
|
363 |
test filename-5.7 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
364 |
testsetplatform mac
|
sl@0
|
365 |
file split :a
|
sl@0
|
366 |
} {a}
|
sl@0
|
367 |
test filename-5.8 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
368 |
testsetplatform mac
|
sl@0
|
369 |
file split :a::
|
sl@0
|
370 |
} {a ::}
|
sl@0
|
371 |
test filename-5.9 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
372 |
testsetplatform mac
|
sl@0
|
373 |
file split :
|
sl@0
|
374 |
} {:}
|
sl@0
|
375 |
test filename-5.10 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
376 |
testsetplatform mac
|
sl@0
|
377 |
file split ::
|
sl@0
|
378 |
} {::}
|
sl@0
|
379 |
test filename-5.11 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
380 |
testsetplatform mac
|
sl@0
|
381 |
file split :::
|
sl@0
|
382 |
} {:: ::}
|
sl@0
|
383 |
test filename-5.12 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
384 |
testsetplatform mac
|
sl@0
|
385 |
file split a:::b
|
sl@0
|
386 |
} {a: :: :: b}
|
sl@0
|
387 |
test filename-5.13 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
388 |
testsetplatform mac
|
sl@0
|
389 |
file split /a:b
|
sl@0
|
390 |
} {/a: b}
|
sl@0
|
391 |
test filename-5.14 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
392 |
testsetplatform mac
|
sl@0
|
393 |
file split ~:
|
sl@0
|
394 |
} {~:}
|
sl@0
|
395 |
test filename-5.15 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
396 |
testsetplatform mac
|
sl@0
|
397 |
file split ~/:
|
sl@0
|
398 |
} {~/:}
|
sl@0
|
399 |
test filename-5.16 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
400 |
testsetplatform mac
|
sl@0
|
401 |
file split ~:foo
|
sl@0
|
402 |
} {~: foo}
|
sl@0
|
403 |
test filename-5.17 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
404 |
testsetplatform mac
|
sl@0
|
405 |
file split ~/foo
|
sl@0
|
406 |
} {~: foo}
|
sl@0
|
407 |
test filename-5.18 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
408 |
testsetplatform mac
|
sl@0
|
409 |
file split ~foo:
|
sl@0
|
410 |
} {~foo:}
|
sl@0
|
411 |
test filename-5.19 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
412 |
testsetplatform mac
|
sl@0
|
413 |
file split a:~foo
|
sl@0
|
414 |
} {a: :~foo}
|
sl@0
|
415 |
test filename-5.20 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
416 |
testsetplatform mac
|
sl@0
|
417 |
file split /
|
sl@0
|
418 |
} {:/}
|
sl@0
|
419 |
test filename-5.21 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
420 |
testsetplatform mac
|
sl@0
|
421 |
file split a:b/c
|
sl@0
|
422 |
} {a: :b/c}
|
sl@0
|
423 |
test filename-5.22 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
424 |
testsetplatform mac
|
sl@0
|
425 |
file split /foo
|
sl@0
|
426 |
} {foo:}
|
sl@0
|
427 |
test filename-5.23 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
428 |
testsetplatform mac
|
sl@0
|
429 |
file split /a/b
|
sl@0
|
430 |
} {a: b}
|
sl@0
|
431 |
test filename-5.24 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
432 |
testsetplatform mac
|
sl@0
|
433 |
file split /a/b/foo
|
sl@0
|
434 |
} {a: b foo}
|
sl@0
|
435 |
test filename-5.25 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
436 |
testsetplatform mac
|
sl@0
|
437 |
file split a/b
|
sl@0
|
438 |
} {a b}
|
sl@0
|
439 |
test filename-5.26 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
440 |
testsetplatform mac
|
sl@0
|
441 |
file split ./foo/bar
|
sl@0
|
442 |
} {: foo bar}
|
sl@0
|
443 |
test filename-5.27 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
444 |
testsetplatform mac
|
sl@0
|
445 |
file split ../foo/bar
|
sl@0
|
446 |
} {:: foo bar}
|
sl@0
|
447 |
test filename-5.28 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
448 |
testsetplatform mac
|
sl@0
|
449 |
file split {}
|
sl@0
|
450 |
} {}
|
sl@0
|
451 |
test filename-5.29 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
452 |
testsetplatform mac
|
sl@0
|
453 |
file split .
|
sl@0
|
454 |
} {:}
|
sl@0
|
455 |
test filename-5.30 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
456 |
testsetplatform mac
|
sl@0
|
457 |
file split ././
|
sl@0
|
458 |
} {: :}
|
sl@0
|
459 |
test filename-5.31 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
460 |
testsetplatform mac
|
sl@0
|
461 |
file split ././.
|
sl@0
|
462 |
} {: : :}
|
sl@0
|
463 |
test filename-5.32 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
464 |
testsetplatform mac
|
sl@0
|
465 |
file split ../
|
sl@0
|
466 |
} {::}
|
sl@0
|
467 |
test filename-5.33 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
468 |
testsetplatform mac
|
sl@0
|
469 |
file split ..
|
sl@0
|
470 |
} {::}
|
sl@0
|
471 |
test filename-5.34 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
472 |
testsetplatform mac
|
sl@0
|
473 |
file split ../..
|
sl@0
|
474 |
} {:: ::}
|
sl@0
|
475 |
test filename-5.35 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
476 |
testsetplatform mac
|
sl@0
|
477 |
file split //foo
|
sl@0
|
478 |
} {foo:}
|
sl@0
|
479 |
test filename-5.36 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
480 |
testsetplatform mac
|
sl@0
|
481 |
file split foo//bar
|
sl@0
|
482 |
} {foo bar}
|
sl@0
|
483 |
test filename-5.37 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
484 |
testsetplatform mac
|
sl@0
|
485 |
file split ~foo
|
sl@0
|
486 |
} {~foo:}
|
sl@0
|
487 |
test filename-5.38 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
488 |
testsetplatform mac
|
sl@0
|
489 |
file split ~
|
sl@0
|
490 |
} {~:}
|
sl@0
|
491 |
test filename-5.39 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
492 |
testsetplatform mac
|
sl@0
|
493 |
file split foo
|
sl@0
|
494 |
} {foo}
|
sl@0
|
495 |
test filename-5.40 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
496 |
testsetplatform mac
|
sl@0
|
497 |
file split ~/
|
sl@0
|
498 |
} {~:}
|
sl@0
|
499 |
test filename-5.41 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
500 |
testsetplatform mac
|
sl@0
|
501 |
file split ~foo/~bar
|
sl@0
|
502 |
} {~foo: :~bar}
|
sl@0
|
503 |
test filename-5.42 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
504 |
testsetplatform mac
|
sl@0
|
505 |
file split ~foo/~bar/~baz
|
sl@0
|
506 |
} {~foo: :~bar :~baz}
|
sl@0
|
507 |
test filename-5.43 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
508 |
testsetplatform mac
|
sl@0
|
509 |
file split foo/bar~/baz
|
sl@0
|
510 |
} {foo bar~ baz}
|
sl@0
|
511 |
test filename-5.44 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
512 |
testsetplatform mac
|
sl@0
|
513 |
file split a/../b
|
sl@0
|
514 |
} {a :: b}
|
sl@0
|
515 |
test filename-5.45 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
516 |
testsetplatform mac
|
sl@0
|
517 |
file split a/../../b
|
sl@0
|
518 |
} {a :: :: b}
|
sl@0
|
519 |
test filename-5.46 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
520 |
testsetplatform mac
|
sl@0
|
521 |
file split a/.././../b
|
sl@0
|
522 |
} {a :: : :: b}
|
sl@0
|
523 |
test filename-5.47 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
524 |
testsetplatform mac
|
sl@0
|
525 |
file split /../bar
|
sl@0
|
526 |
} {bar:}
|
sl@0
|
527 |
test filename-5.48 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
528 |
testsetplatform mac
|
sl@0
|
529 |
file split /./bar
|
sl@0
|
530 |
} {bar:}
|
sl@0
|
531 |
test filename-5.49 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
532 |
testsetplatform mac
|
sl@0
|
533 |
file split //.//.././bar
|
sl@0
|
534 |
} {bar:}
|
sl@0
|
535 |
test filename-5.50 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
536 |
testsetplatform mac
|
sl@0
|
537 |
file split /..
|
sl@0
|
538 |
} {:/..}
|
sl@0
|
539 |
test filename-5.51 {Tcl_SplitPath: mac} {testsetplatform} {
|
sl@0
|
540 |
testsetplatform mac
|
sl@0
|
541 |
file split //.//.././
|
sl@0
|
542 |
} {://.//.././}
|
sl@0
|
543 |
|
sl@0
|
544 |
test filename-6.1 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
545 |
testsetplatform win
|
sl@0
|
546 |
file split /
|
sl@0
|
547 |
} {/}
|
sl@0
|
548 |
test filename-6.2 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
549 |
testsetplatform win
|
sl@0
|
550 |
file split /foo
|
sl@0
|
551 |
} {/ foo}
|
sl@0
|
552 |
test filename-6.3 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
553 |
testsetplatform win
|
sl@0
|
554 |
file split /foo/bar
|
sl@0
|
555 |
} {/ foo bar}
|
sl@0
|
556 |
test filename-6.4 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
557 |
testsetplatform win
|
sl@0
|
558 |
file split /foo/bar/baz
|
sl@0
|
559 |
} {/ foo bar baz}
|
sl@0
|
560 |
test filename-6.5 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
561 |
testsetplatform win
|
sl@0
|
562 |
file split foo/bar
|
sl@0
|
563 |
} {foo bar}
|
sl@0
|
564 |
test filename-6.6 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
565 |
testsetplatform win
|
sl@0
|
566 |
file split ./foo/bar
|
sl@0
|
567 |
} {. foo bar}
|
sl@0
|
568 |
test filename-6.7 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
569 |
testsetplatform win
|
sl@0
|
570 |
file split /foo/../././foo/bar
|
sl@0
|
571 |
} {/ foo .. . . foo bar}
|
sl@0
|
572 |
test filename-6.8 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
573 |
testsetplatform win
|
sl@0
|
574 |
file split ../foo/bar
|
sl@0
|
575 |
} {.. foo bar}
|
sl@0
|
576 |
test filename-6.9 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
577 |
testsetplatform win
|
sl@0
|
578 |
file split {}
|
sl@0
|
579 |
} {}
|
sl@0
|
580 |
test filename-6.10 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
581 |
testsetplatform win
|
sl@0
|
582 |
file split .
|
sl@0
|
583 |
} {.}
|
sl@0
|
584 |
test filename-6.11 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
585 |
testsetplatform win
|
sl@0
|
586 |
file split ../
|
sl@0
|
587 |
} {..}
|
sl@0
|
588 |
test filename-6.12 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
589 |
testsetplatform win
|
sl@0
|
590 |
file split ../..
|
sl@0
|
591 |
} {.. ..}
|
sl@0
|
592 |
test filename-6.13 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
593 |
testsetplatform win
|
sl@0
|
594 |
file split //foo
|
sl@0
|
595 |
} {/ foo}
|
sl@0
|
596 |
test filename-6.14 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
597 |
testsetplatform win
|
sl@0
|
598 |
file split foo//bar
|
sl@0
|
599 |
} {foo bar}
|
sl@0
|
600 |
test filename-6.15 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
601 |
testsetplatform win
|
sl@0
|
602 |
file split /\\/foo//bar
|
sl@0
|
603 |
} {//foo/bar}
|
sl@0
|
604 |
test filename-6.16 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
605 |
testsetplatform win
|
sl@0
|
606 |
file split /\\/foo//bar
|
sl@0
|
607 |
} {//foo/bar}
|
sl@0
|
608 |
test filename-6.17 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
609 |
testsetplatform win
|
sl@0
|
610 |
file split /\\/foo//bar
|
sl@0
|
611 |
} {//foo/bar}
|
sl@0
|
612 |
test filename-6.18 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
613 |
testsetplatform win
|
sl@0
|
614 |
file split \\\\foo\\bar
|
sl@0
|
615 |
} {//foo/bar}
|
sl@0
|
616 |
test filename-6.19 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
617 |
testsetplatform win
|
sl@0
|
618 |
file split \\\\foo\\bar/baz
|
sl@0
|
619 |
} {//foo/bar baz}
|
sl@0
|
620 |
test filename-6.20 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
621 |
testsetplatform win
|
sl@0
|
622 |
file split c:/foo
|
sl@0
|
623 |
} {c:/ foo}
|
sl@0
|
624 |
test filename-6.21 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
625 |
testsetplatform win
|
sl@0
|
626 |
file split c:foo
|
sl@0
|
627 |
} {c: foo}
|
sl@0
|
628 |
test filename-6.22 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
629 |
testsetplatform win
|
sl@0
|
630 |
file split c:
|
sl@0
|
631 |
} {c:}
|
sl@0
|
632 |
test filename-6.23 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
633 |
testsetplatform win
|
sl@0
|
634 |
file split c:\\
|
sl@0
|
635 |
} {c:/}
|
sl@0
|
636 |
test filename-6.24 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
637 |
testsetplatform win
|
sl@0
|
638 |
file split c:/
|
sl@0
|
639 |
} {c:/}
|
sl@0
|
640 |
test filename-6.25 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
641 |
testsetplatform win
|
sl@0
|
642 |
file split c:/./..
|
sl@0
|
643 |
} {c:/ . ..}
|
sl@0
|
644 |
test filename-6.26 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
645 |
testsetplatform win
|
sl@0
|
646 |
file split ~foo
|
sl@0
|
647 |
} {~foo}
|
sl@0
|
648 |
test filename-6.27 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
649 |
testsetplatform win
|
sl@0
|
650 |
file split ~foo/~bar
|
sl@0
|
651 |
} {~foo ./~bar}
|
sl@0
|
652 |
test filename-6.28 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
653 |
testsetplatform win
|
sl@0
|
654 |
file split ~foo/~bar/~baz
|
sl@0
|
655 |
} {~foo ./~bar ./~baz}
|
sl@0
|
656 |
test filename-6.29 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
657 |
testsetplatform win
|
sl@0
|
658 |
file split foo/bar~/baz
|
sl@0
|
659 |
} {foo bar~ baz}
|
sl@0
|
660 |
test filename-6.30 {Tcl_SplitPath: win} {testsetplatform} {
|
sl@0
|
661 |
testsetplatform win
|
sl@0
|
662 |
file split c:~foo
|
sl@0
|
663 |
} {c: ./~foo}
|
sl@0
|
664 |
|
sl@0
|
665 |
test filename-7.1 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
666 |
testsetplatform unix
|
sl@0
|
667 |
file join / a
|
sl@0
|
668 |
} {/a}
|
sl@0
|
669 |
test filename-7.2 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
670 |
testsetplatform unix
|
sl@0
|
671 |
file join a b
|
sl@0
|
672 |
} {a/b}
|
sl@0
|
673 |
test filename-7.3 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
674 |
testsetplatform unix
|
sl@0
|
675 |
file join /a c /b d
|
sl@0
|
676 |
} {/b/d}
|
sl@0
|
677 |
test filename-7.4 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
678 |
testsetplatform unix
|
sl@0
|
679 |
file join /
|
sl@0
|
680 |
} {/}
|
sl@0
|
681 |
test filename-7.5 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
682 |
testsetplatform unix
|
sl@0
|
683 |
file join a
|
sl@0
|
684 |
} {a}
|
sl@0
|
685 |
test filename-7.6 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
686 |
testsetplatform unix
|
sl@0
|
687 |
file join {}
|
sl@0
|
688 |
} {}
|
sl@0
|
689 |
test filename-7.7 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
690 |
testsetplatform unix
|
sl@0
|
691 |
file join /a/ b
|
sl@0
|
692 |
} {/a/b}
|
sl@0
|
693 |
test filename-7.8 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
694 |
testsetplatform unix
|
sl@0
|
695 |
file join /a// b
|
sl@0
|
696 |
} {/a/b}
|
sl@0
|
697 |
test filename-7.9 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
698 |
testsetplatform unix
|
sl@0
|
699 |
file join /a/./../. b
|
sl@0
|
700 |
} {/a/./.././b}
|
sl@0
|
701 |
test filename-7.10 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
702 |
testsetplatform unix
|
sl@0
|
703 |
file join ~ a
|
sl@0
|
704 |
} {~/a}
|
sl@0
|
705 |
test filename-7.11 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
706 |
testsetplatform unix
|
sl@0
|
707 |
file join ~a ~b
|
sl@0
|
708 |
} {~b}
|
sl@0
|
709 |
test filename-7.12 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
710 |
testsetplatform unix
|
sl@0
|
711 |
file join ./~a b
|
sl@0
|
712 |
} {./~a/b}
|
sl@0
|
713 |
test filename-7.13 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
714 |
testsetplatform unix
|
sl@0
|
715 |
file join ./~a ~b
|
sl@0
|
716 |
} {~b}
|
sl@0
|
717 |
test filename-7.14 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
718 |
testsetplatform unix
|
sl@0
|
719 |
file join ./~a ./~b
|
sl@0
|
720 |
} {./~a/~b}
|
sl@0
|
721 |
test filename-7.15 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
722 |
testsetplatform unix
|
sl@0
|
723 |
file join a . b
|
sl@0
|
724 |
} {a/./b}
|
sl@0
|
725 |
test filename-7.16 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
726 |
testsetplatform unix
|
sl@0
|
727 |
file join a . ./~b
|
sl@0
|
728 |
} {a/./~b}
|
sl@0
|
729 |
test filename-7.17 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
730 |
testsetplatform unix
|
sl@0
|
731 |
file join //a b
|
sl@0
|
732 |
} {/a/b}
|
sl@0
|
733 |
test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
734 |
testsetplatform unix
|
sl@0
|
735 |
file join /// a b
|
sl@0
|
736 |
} {/a/b}
|
sl@0
|
737 |
|
sl@0
|
738 |
test filename-8.1 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
739 |
testsetplatform mac
|
sl@0
|
740 |
file join a b
|
sl@0
|
741 |
} {:a:b}
|
sl@0
|
742 |
test filename-8.2 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
743 |
testsetplatform mac
|
sl@0
|
744 |
file join :a b
|
sl@0
|
745 |
} {:a:b}
|
sl@0
|
746 |
test filename-8.3 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
747 |
testsetplatform mac
|
sl@0
|
748 |
file join a b:
|
sl@0
|
749 |
} {b:}
|
sl@0
|
750 |
test filename-8.4 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
751 |
testsetplatform mac
|
sl@0
|
752 |
file join a: :b
|
sl@0
|
753 |
} {a:b}
|
sl@0
|
754 |
test filename-8.5 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
755 |
testsetplatform mac
|
sl@0
|
756 |
file join a: :b:
|
sl@0
|
757 |
} {a:b}
|
sl@0
|
758 |
test filename-8.6 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
759 |
testsetplatform mac
|
sl@0
|
760 |
file join a :: b
|
sl@0
|
761 |
} {:a::b}
|
sl@0
|
762 |
test filename-8.7 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
763 |
testsetplatform mac
|
sl@0
|
764 |
file join a :: :: b
|
sl@0
|
765 |
} {:a:::b}
|
sl@0
|
766 |
test filename-8.8 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
767 |
testsetplatform mac
|
sl@0
|
768 |
file join a ::: b
|
sl@0
|
769 |
} {:a:::b}
|
sl@0
|
770 |
test filename-8.9 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
771 |
testsetplatform mac
|
sl@0
|
772 |
file join a: b:
|
sl@0
|
773 |
} {b:}
|
sl@0
|
774 |
test filename-8.10 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
775 |
testsetplatform mac
|
sl@0
|
776 |
file join /a/b
|
sl@0
|
777 |
} {a:b}
|
sl@0
|
778 |
test filename-8.11 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
779 |
testsetplatform mac
|
sl@0
|
780 |
file join /a/b c/d
|
sl@0
|
781 |
} {a:b:c:d}
|
sl@0
|
782 |
test filename-8.12 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
783 |
testsetplatform mac
|
sl@0
|
784 |
file join /a/b :c:d
|
sl@0
|
785 |
} {a:b:c:d}
|
sl@0
|
786 |
test filename-8.13 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
787 |
testsetplatform mac
|
sl@0
|
788 |
file join ~ foo
|
sl@0
|
789 |
} {~:foo}
|
sl@0
|
790 |
test filename-8.14 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
791 |
testsetplatform mac
|
sl@0
|
792 |
file join :: ::
|
sl@0
|
793 |
} {:::}
|
sl@0
|
794 |
test filename-8.15 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
795 |
testsetplatform mac
|
sl@0
|
796 |
file join a: ::
|
sl@0
|
797 |
} {a::}
|
sl@0
|
798 |
test filename-8.16 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
799 |
testsetplatform mac
|
sl@0
|
800 |
file join a {} b
|
sl@0
|
801 |
} {:a:b}
|
sl@0
|
802 |
test filename-8.17 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
803 |
testsetplatform mac
|
sl@0
|
804 |
file join a::: b
|
sl@0
|
805 |
} {a:::b}
|
sl@0
|
806 |
test filename-8.18 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
807 |
testsetplatform mac
|
sl@0
|
808 |
file join a : : :
|
sl@0
|
809 |
} {:a}
|
sl@0
|
810 |
test filename-8.19 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
811 |
testsetplatform mac
|
sl@0
|
812 |
file join :
|
sl@0
|
813 |
} {:}
|
sl@0
|
814 |
test filename-8.20 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
815 |
testsetplatform mac
|
sl@0
|
816 |
file join : a
|
sl@0
|
817 |
} {:a}
|
sl@0
|
818 |
test filename-8.21 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
819 |
testsetplatform mac
|
sl@0
|
820 |
file join a: :b/c
|
sl@0
|
821 |
} {a:b/c}
|
sl@0
|
822 |
test filename-8.22 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
823 |
testsetplatform mac
|
sl@0
|
824 |
file join :a :b/c
|
sl@0
|
825 |
} {:a:b/c}
|
sl@0
|
826 |
|
sl@0
|
827 |
test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
828 |
testsetplatform win
|
sl@0
|
829 |
file join a b
|
sl@0
|
830 |
} {a/b}
|
sl@0
|
831 |
test filename-9.2 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
832 |
testsetplatform win
|
sl@0
|
833 |
file join /a b
|
sl@0
|
834 |
} {/a/b}
|
sl@0
|
835 |
test filename-9.3 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
836 |
testsetplatform win
|
sl@0
|
837 |
file join /a /b
|
sl@0
|
838 |
} {/b}
|
sl@0
|
839 |
test filename-9.4 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
840 |
testsetplatform win
|
sl@0
|
841 |
file join c: foo
|
sl@0
|
842 |
} {c:foo}
|
sl@0
|
843 |
test filename-9.5 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
844 |
testsetplatform win
|
sl@0
|
845 |
file join c:/ foo
|
sl@0
|
846 |
} {c:/foo}
|
sl@0
|
847 |
test filename-9.6 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
848 |
testsetplatform win
|
sl@0
|
849 |
file join c:\\bar foo
|
sl@0
|
850 |
} {c:/bar/foo}
|
sl@0
|
851 |
test filename-9.7 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
852 |
testsetplatform win
|
sl@0
|
853 |
file join /foo c:bar
|
sl@0
|
854 |
} {c:bar}
|
sl@0
|
855 |
test filename-9.8 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
856 |
testsetplatform win
|
sl@0
|
857 |
file join ///host//share dir
|
sl@0
|
858 |
} {//host/share/dir}
|
sl@0
|
859 |
test filename-9.9 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
860 |
testsetplatform win
|
sl@0
|
861 |
file join ~ foo
|
sl@0
|
862 |
} {~/foo}
|
sl@0
|
863 |
test filename-9.10 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
864 |
testsetplatform win
|
sl@0
|
865 |
file join ~/~foo
|
sl@0
|
866 |
} {~/~foo}
|
sl@0
|
867 |
test filename-9.11 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
868 |
testsetplatform win
|
sl@0
|
869 |
file join ~ ./~foo
|
sl@0
|
870 |
} {~/~foo}
|
sl@0
|
871 |
test filename-9.12 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
872 |
testsetplatform win
|
sl@0
|
873 |
file join / ~foo
|
sl@0
|
874 |
} {~foo}
|
sl@0
|
875 |
test filename-9.13 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
876 |
testsetplatform win
|
sl@0
|
877 |
file join ./a/ b c
|
sl@0
|
878 |
} {./a/b/c}
|
sl@0
|
879 |
test filename-9.14 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
880 |
testsetplatform win
|
sl@0
|
881 |
file join ./~a/ b c
|
sl@0
|
882 |
} {./~a/b/c}
|
sl@0
|
883 |
test filename-9.15 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
884 |
testsetplatform win
|
sl@0
|
885 |
file join // host share path
|
sl@0
|
886 |
} {/host/share/path}
|
sl@0
|
887 |
test filename-9.16 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
888 |
testsetplatform win
|
sl@0
|
889 |
file join foo . bar
|
sl@0
|
890 |
} {foo/./bar}
|
sl@0
|
891 |
test filename-9.17 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
892 |
testsetplatform win
|
sl@0
|
893 |
file join foo .. bar
|
sl@0
|
894 |
} {foo/../bar}
|
sl@0
|
895 |
test filename-9.18 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
896 |
testsetplatform win
|
sl@0
|
897 |
file join foo/./bar
|
sl@0
|
898 |
} {foo/./bar}
|
sl@0
|
899 |
test filename-9.19 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
900 |
testsetplatform win
|
sl@0
|
901 |
set res {}
|
sl@0
|
902 |
lappend res \
|
sl@0
|
903 |
[file join {C:\foo\bar}] \
|
sl@0
|
904 |
[file join C:/blah {C:\foo\bar}] \
|
sl@0
|
905 |
[file join C:/blah C:/blah {C:\foo\bar}]
|
sl@0
|
906 |
} {C:/foo/bar C:/foo/bar C:/foo/bar}
|
sl@0
|
907 |
test filename-9.19.1 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
908 |
testsetplatform win
|
sl@0
|
909 |
set res {}
|
sl@0
|
910 |
lappend res \
|
sl@0
|
911 |
[file join {foo\bar}] \
|
sl@0
|
912 |
[file join C:/blah {foo\bar}] \
|
sl@0
|
913 |
[file join C:/blah C:/blah {foo\bar}]
|
sl@0
|
914 |
} {foo/bar C:/blah/foo/bar C:/blah/foo/bar}
|
sl@0
|
915 |
test filename-9.19.2 {Tcl_JoinPath: win} {testsetplatform winOnly} {
|
sl@0
|
916 |
testsetplatform win
|
sl@0
|
917 |
set res {}
|
sl@0
|
918 |
lappend res \
|
sl@0
|
919 |
[file join {foo\bar}] \
|
sl@0
|
920 |
[file join [pwd] {foo\bar}] \
|
sl@0
|
921 |
[file join [pwd] [pwd] {foo\bar}]
|
sl@0
|
922 |
string map [list [pwd] pwd] $res
|
sl@0
|
923 |
} {foo/bar pwd/foo/bar pwd/foo/bar}
|
sl@0
|
924 |
test filename-9.20 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
925 |
testsetplatform unix
|
sl@0
|
926 |
set res {}
|
sl@0
|
927 |
lappend res \
|
sl@0
|
928 |
[file join {/foo/bar}] \
|
sl@0
|
929 |
[file join /x {/foo/bar}] \
|
sl@0
|
930 |
[file join /x /x {/foo/bar}]
|
sl@0
|
931 |
} {/foo/bar /foo/bar /foo/bar}
|
sl@0
|
932 |
test filename-9.21 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
933 |
testsetplatform mac
|
sl@0
|
934 |
set res {}
|
sl@0
|
935 |
lappend res \
|
sl@0
|
936 |
[file join {/foo/bar}] \
|
sl@0
|
937 |
[file join drive: {/foo/bar}] \
|
sl@0
|
938 |
[file join drive: drive: {/foo/bar}]
|
sl@0
|
939 |
} {foo:bar foo:bar foo:bar}
|
sl@0
|
940 |
test filename-9.22 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
941 |
testsetplatform mac
|
sl@0
|
942 |
set res {}
|
sl@0
|
943 |
lappend res \
|
sl@0
|
944 |
[file join {foo:bar}] \
|
sl@0
|
945 |
[file join drive: {foo:bar}] \
|
sl@0
|
946 |
[file join drive: drive: {foo:bar}]
|
sl@0
|
947 |
} {foo:bar foo:bar foo:bar}
|
sl@0
|
948 |
test filename-9.23 {Tcl_JoinPath: win} {testsetplatform} {
|
sl@0
|
949 |
testsetplatform win
|
sl@0
|
950 |
set res {}
|
sl@0
|
951 |
lappend res \
|
sl@0
|
952 |
[file join {foo\bar}] \
|
sl@0
|
953 |
[file join C:/blah {foo\bar}] \
|
sl@0
|
954 |
[file join C:/blah C:/blah {foo\bar}]
|
sl@0
|
955 |
string map [list C:/blah ""] $res
|
sl@0
|
956 |
} {foo/bar /foo/bar /foo/bar}
|
sl@0
|
957 |
test filename-9.24 {Tcl_JoinPath: unix} {testsetplatform} {
|
sl@0
|
958 |
testsetplatform unix
|
sl@0
|
959 |
set res {}
|
sl@0
|
960 |
lappend res \
|
sl@0
|
961 |
[file join {foo/bar}] \
|
sl@0
|
962 |
[file join /x {foo/bar}] \
|
sl@0
|
963 |
[file join /x /x {foo/bar}]
|
sl@0
|
964 |
string map [list /x ""] $res
|
sl@0
|
965 |
} {foo/bar /foo/bar /foo/bar}
|
sl@0
|
966 |
test filename-9.25 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
967 |
testsetplatform mac
|
sl@0
|
968 |
set res {}
|
sl@0
|
969 |
lappend res \
|
sl@0
|
970 |
[file join {foo/bar}] \
|
sl@0
|
971 |
[file join drive: {foo/bar}] \
|
sl@0
|
972 |
[file join drive: drive: {foo/bar}]
|
sl@0
|
973 |
string map [list drive: ""] $res
|
sl@0
|
974 |
} {:foo:bar foo:bar foo:bar}
|
sl@0
|
975 |
test filename-9.26 {Tcl_JoinPath: mac} {testsetplatform} {
|
sl@0
|
976 |
testsetplatform mac
|
sl@0
|
977 |
set res {}
|
sl@0
|
978 |
lappend res \
|
sl@0
|
979 |
[file join {:foo:bar}] \
|
sl@0
|
980 |
[file join drive: {:foo:bar}] \
|
sl@0
|
981 |
[file join drive: drive: {:foo:bar}]
|
sl@0
|
982 |
string map [list drive: ""] $res
|
sl@0
|
983 |
} {:foo:bar foo:bar foo:bar}
|
sl@0
|
984 |
|
sl@0
|
985 |
test filename-10.1 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
986 |
testsetplatform unix
|
sl@0
|
987 |
list [catch {testtranslatefilename foo} msg] $msg
|
sl@0
|
988 |
} {0 foo}
|
sl@0
|
989 |
test filename-10.2 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
990 |
testsetplatform windows
|
sl@0
|
991 |
list [catch {testtranslatefilename {c:/foo}} msg] $msg
|
sl@0
|
992 |
} {0 {c:\foo}}
|
sl@0
|
993 |
test filename-10.3 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
994 |
testsetplatform windows
|
sl@0
|
995 |
list [catch {testtranslatefilename {c:/\\foo/}} msg] $msg
|
sl@0
|
996 |
} {0 {c:\foo}}
|
sl@0
|
997 |
test filename-10.4 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
998 |
testsetplatform mac
|
sl@0
|
999 |
list [catch {testtranslatefilename foo} msg] $msg
|
sl@0
|
1000 |
} {0 :foo}
|
sl@0
|
1001 |
test filename-10.5 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1002 |
testsetplatform mac
|
sl@0
|
1003 |
list [catch {testtranslatefilename :~foo} msg] $msg
|
sl@0
|
1004 |
} {0 :~foo}
|
sl@0
|
1005 |
test filename-10.6 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1006 |
global env
|
sl@0
|
1007 |
set temp $env(HOME)
|
sl@0
|
1008 |
set env(HOME) "/home/test"
|
sl@0
|
1009 |
testsetplatform unix
|
sl@0
|
1010 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1011 |
set env(HOME) $temp
|
sl@0
|
1012 |
set result
|
sl@0
|
1013 |
} {0 /home/test/foo}
|
sl@0
|
1014 |
test filename-10.7 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1015 |
global env
|
sl@0
|
1016 |
set temp $env(HOME)
|
sl@0
|
1017 |
unset env(HOME)
|
sl@0
|
1018 |
testsetplatform unix
|
sl@0
|
1019 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1020 |
set env(HOME) $temp
|
sl@0
|
1021 |
set result
|
sl@0
|
1022 |
} {1 {couldn't find HOME environment variable to expand path}}
|
sl@0
|
1023 |
test filename-10.8 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1024 |
global env
|
sl@0
|
1025 |
set temp $env(HOME)
|
sl@0
|
1026 |
set env(HOME) "/home/test"
|
sl@0
|
1027 |
testsetplatform unix
|
sl@0
|
1028 |
set result [list [catch {testtranslatefilename ~} msg] $msg]
|
sl@0
|
1029 |
set env(HOME) $temp
|
sl@0
|
1030 |
set result
|
sl@0
|
1031 |
} {0 /home/test}
|
sl@0
|
1032 |
test filename-10.9 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1033 |
global env
|
sl@0
|
1034 |
set temp $env(HOME)
|
sl@0
|
1035 |
set env(HOME) "/home/test/"
|
sl@0
|
1036 |
testsetplatform unix
|
sl@0
|
1037 |
set result [list [catch {testtranslatefilename ~} msg] $msg]
|
sl@0
|
1038 |
set env(HOME) $temp
|
sl@0
|
1039 |
set result
|
sl@0
|
1040 |
} {0 /home/test}
|
sl@0
|
1041 |
test filename-10.10 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1042 |
global env
|
sl@0
|
1043 |
set temp $env(HOME)
|
sl@0
|
1044 |
set env(HOME) "/home/test/"
|
sl@0
|
1045 |
testsetplatform unix
|
sl@0
|
1046 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1047 |
set env(HOME) $temp
|
sl@0
|
1048 |
set result
|
sl@0
|
1049 |
} {0 /home/test/foo}
|
sl@0
|
1050 |
test filename-10.11 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1051 |
global env
|
sl@0
|
1052 |
set temp $env(HOME)
|
sl@0
|
1053 |
set env(HOME) "Root:"
|
sl@0
|
1054 |
testsetplatform mac
|
sl@0
|
1055 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1056 |
set env(HOME) $temp
|
sl@0
|
1057 |
set result
|
sl@0
|
1058 |
} {0 Root:foo}
|
sl@0
|
1059 |
test filename-10.12 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1060 |
global env
|
sl@0
|
1061 |
set temp $env(HOME)
|
sl@0
|
1062 |
set env(HOME) "Root:home"
|
sl@0
|
1063 |
testsetplatform mac
|
sl@0
|
1064 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1065 |
set env(HOME) $temp
|
sl@0
|
1066 |
set result
|
sl@0
|
1067 |
} {0 Root:home:foo}
|
sl@0
|
1068 |
test filename-10.13 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1069 |
global env
|
sl@0
|
1070 |
set temp $env(HOME)
|
sl@0
|
1071 |
set env(HOME) "Root:home"
|
sl@0
|
1072 |
testsetplatform mac
|
sl@0
|
1073 |
set result [list [catch {testtranslatefilename ~::foo} msg] $msg]
|
sl@0
|
1074 |
set env(HOME) $temp
|
sl@0
|
1075 |
set result
|
sl@0
|
1076 |
} {0 Root:home::foo}
|
sl@0
|
1077 |
test filename-10.14 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1078 |
global env
|
sl@0
|
1079 |
set temp $env(HOME)
|
sl@0
|
1080 |
set env(HOME) "Root:home"
|
sl@0
|
1081 |
testsetplatform mac
|
sl@0
|
1082 |
set result [list [catch {testtranslatefilename ~} msg] $msg]
|
sl@0
|
1083 |
set env(HOME) $temp
|
sl@0
|
1084 |
set result
|
sl@0
|
1085 |
} {0 Root:home}
|
sl@0
|
1086 |
test filename-10.15 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1087 |
global env
|
sl@0
|
1088 |
set temp $env(HOME)
|
sl@0
|
1089 |
set env(HOME) "Root:home:"
|
sl@0
|
1090 |
testsetplatform mac
|
sl@0
|
1091 |
set result [list [catch {testtranslatefilename ~::foo} msg] $msg]
|
sl@0
|
1092 |
set env(HOME) $temp
|
sl@0
|
1093 |
set result
|
sl@0
|
1094 |
} {0 Root:home::foo}
|
sl@0
|
1095 |
test filename-10.16 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1096 |
global env
|
sl@0
|
1097 |
set temp $env(HOME)
|
sl@0
|
1098 |
set env(HOME) "Root:home::"
|
sl@0
|
1099 |
testsetplatform mac
|
sl@0
|
1100 |
set result [list [catch {testtranslatefilename ~::foo} msg] $msg]
|
sl@0
|
1101 |
set env(HOME) $temp
|
sl@0
|
1102 |
set result
|
sl@0
|
1103 |
} {0 Root:home:::foo}
|
sl@0
|
1104 |
test filename-10.17 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1105 |
global env
|
sl@0
|
1106 |
set temp $env(HOME)
|
sl@0
|
1107 |
set env(HOME) "\\home\\"
|
sl@0
|
1108 |
testsetplatform windows
|
sl@0
|
1109 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1110 |
set env(HOME) $temp
|
sl@0
|
1111 |
set result
|
sl@0
|
1112 |
} {0 {\home\foo}}
|
sl@0
|
1113 |
test filename-10.18 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1114 |
global env
|
sl@0
|
1115 |
set temp $env(HOME)
|
sl@0
|
1116 |
set env(HOME) "\\home\\"
|
sl@0
|
1117 |
testsetplatform windows
|
sl@0
|
1118 |
set result [list [catch {testtranslatefilename ~/foo\\bar} msg] $msg]
|
sl@0
|
1119 |
set env(HOME) $temp
|
sl@0
|
1120 |
set result
|
sl@0
|
1121 |
} {0 {\home\foo\bar}}
|
sl@0
|
1122 |
test filename-10.19 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1123 |
global env
|
sl@0
|
1124 |
set temp $env(HOME)
|
sl@0
|
1125 |
set env(HOME) "c:"
|
sl@0
|
1126 |
testsetplatform windows
|
sl@0
|
1127 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1128 |
set env(HOME) $temp
|
sl@0
|
1129 |
set result
|
sl@0
|
1130 |
} {0 c:foo}
|
sl@0
|
1131 |
test filename-10.20 {Tcl_TranslateFileName} {testtranslatefilename} {
|
sl@0
|
1132 |
list [catch {testtranslatefilename ~blorp/foo} msg] $msg
|
sl@0
|
1133 |
} {1 {user "blorp" doesn't exist}}
|
sl@0
|
1134 |
test filename-10.21 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1135 |
global env
|
sl@0
|
1136 |
set temp $env(HOME)
|
sl@0
|
1137 |
set env(HOME) "c:\\"
|
sl@0
|
1138 |
testsetplatform windows
|
sl@0
|
1139 |
set result [list [catch {testtranslatefilename ~/foo} msg] $msg]
|
sl@0
|
1140 |
set env(HOME) $temp
|
sl@0
|
1141 |
set result
|
sl@0
|
1142 |
} {0 {c:\foo}}
|
sl@0
|
1143 |
test filename-10.22 {Tcl_TranslateFileName} {testsetplatform} {
|
sl@0
|
1144 |
testsetplatform windows
|
sl@0
|
1145 |
list [catch {testtranslatefilename foo//bar} msg] $msg
|
sl@0
|
1146 |
} {0 {foo\bar}}
|
sl@0
|
1147 |
|
sl@0
|
1148 |
if {[tcltest::testConstraint testsetplatform]} {
|
sl@0
|
1149 |
testsetplatform $platform
|
sl@0
|
1150 |
}
|
sl@0
|
1151 |
|
sl@0
|
1152 |
test filename-10.23 {Tcl_TranslateFileName} {unixOnly nonPortable} {
|
sl@0
|
1153 |
# this test fails if ~ouster is not /home/ouster
|
sl@0
|
1154 |
list [catch {testtranslatefilename ~ouster} msg] $msg
|
sl@0
|
1155 |
} {0 /home/ouster}
|
sl@0
|
1156 |
test filename-10.24 {Tcl_TranslateFileName} {unixOnly nonPortable} {
|
sl@0
|
1157 |
# this test fails if ~ouster is not /home/ouster
|
sl@0
|
1158 |
list [catch {testtranslatefilename ~ouster/foo} msg] $msg
|
sl@0
|
1159 |
} {0 /home/ouster/foo}
|
sl@0
|
1160 |
|
sl@0
|
1161 |
|
sl@0
|
1162 |
test filename-11.1 {Tcl_GlobCmd} {
|
sl@0
|
1163 |
list [catch {glob} msg] $msg
|
sl@0
|
1164 |
} {1 {wrong # args: should be "glob ?switches? name ?name ...?"}}
|
sl@0
|
1165 |
test filename-11.2 {Tcl_GlobCmd} {
|
sl@0
|
1166 |
list [catch {glob -gorp} msg] $msg
|
sl@0
|
1167 |
} {1 {bad option "-gorp": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}}
|
sl@0
|
1168 |
test filename-11.3 {Tcl_GlobCmd} {
|
sl@0
|
1169 |
list [catch {glob -nocomplai} msg] $msg
|
sl@0
|
1170 |
} {1 {wrong # args: should be "glob ?switches? name ?name ...?"}}
|
sl@0
|
1171 |
test filename-11.4 {Tcl_GlobCmd} {
|
sl@0
|
1172 |
list [catch {glob -nocomplain} msg] $msg
|
sl@0
|
1173 |
} {1 {wrong # args: should be "glob ?switches? name ?name ...?"}}
|
sl@0
|
1174 |
test filename-11.5 {Tcl_GlobCmd} {
|
sl@0
|
1175 |
list [catch {glob -nocomplain ~xyqrszzz} msg] $msg
|
sl@0
|
1176 |
} {0 {}}
|
sl@0
|
1177 |
test filename-11.6 {Tcl_GlobCmd} {
|
sl@0
|
1178 |
list [catch {glob ~xyqrszzz} msg] $msg
|
sl@0
|
1179 |
} {1 {user "xyqrszzz" doesn't exist}}
|
sl@0
|
1180 |
test filename-11.7 {Tcl_GlobCmd} {
|
sl@0
|
1181 |
list [catch {glob -- -nocomplain} msg] $msg
|
sl@0
|
1182 |
} {1 {no files matched glob pattern "-nocomplain"}}
|
sl@0
|
1183 |
test filename-11.8 {Tcl_GlobCmd} {
|
sl@0
|
1184 |
list [catch {glob -nocomplain -- -nocomplain} msg] $msg
|
sl@0
|
1185 |
} {0 {}}
|
sl@0
|
1186 |
test filename-11.9 {Tcl_GlobCmd} {testsetplatform} {
|
sl@0
|
1187 |
testsetplatform unix
|
sl@0
|
1188 |
list [catch {glob ~\\xyqrszzz/bar} msg] $msg
|
sl@0
|
1189 |
} {1 {user "\xyqrszzz" doesn't exist}}
|
sl@0
|
1190 |
test filename-11.10 {Tcl_GlobCmd} {testsetplatform} {
|
sl@0
|
1191 |
testsetplatform unix
|
sl@0
|
1192 |
list [catch {glob -nocomplain ~\\xyqrszzz/bar} msg] $msg
|
sl@0
|
1193 |
} {0 {}}
|
sl@0
|
1194 |
test filename-11.11 {Tcl_GlobCmd} {testsetplatform} {
|
sl@0
|
1195 |
testsetplatform unix
|
sl@0
|
1196 |
list [catch {glob ~xyqrszzz\\/\\bar} msg] $msg
|
sl@0
|
1197 |
} {1 {user "xyqrszzz" doesn't exist}}
|
sl@0
|
1198 |
test filename-11.12 {Tcl_GlobCmd} {testsetplatform} {
|
sl@0
|
1199 |
testsetplatform unix
|
sl@0
|
1200 |
set home $env(HOME)
|
sl@0
|
1201 |
unset env(HOME)
|
sl@0
|
1202 |
set x [list [catch {glob ~/*} msg] $msg]
|
sl@0
|
1203 |
set env(HOME) $home
|
sl@0
|
1204 |
set x
|
sl@0
|
1205 |
} {1 {couldn't find HOME environment variable to expand path}}
|
sl@0
|
1206 |
|
sl@0
|
1207 |
if {[tcltest::testConstraint testsetplatform]} {
|
sl@0
|
1208 |
testsetplatform $platform
|
sl@0
|
1209 |
}
|
sl@0
|
1210 |
|
sl@0
|
1211 |
test filename-11.13 {Tcl_GlobCmd} {
|
sl@0
|
1212 |
list [catch {file join [lindex [glob ~] 0]} msg] $msg
|
sl@0
|
1213 |
} [list 0 [file join $env(HOME)]]
|
sl@0
|
1214 |
|
sl@0
|
1215 |
set oldpwd [pwd]
|
sl@0
|
1216 |
set oldhome $env(HOME)
|
sl@0
|
1217 |
cd [temporaryDirectory]
|
sl@0
|
1218 |
set env(HOME) [pwd]
|
sl@0
|
1219 |
file delete -force globTest
|
sl@0
|
1220 |
file mkdir globTest/a1/b1
|
sl@0
|
1221 |
file mkdir globTest/a1/b2
|
sl@0
|
1222 |
file mkdir globTest/a2/b3
|
sl@0
|
1223 |
file mkdir globTest/a3
|
sl@0
|
1224 |
close [open globTest/x1.c w]
|
sl@0
|
1225 |
close [open globTest/y1.c w]
|
sl@0
|
1226 |
close [open globTest/z1.c w]
|
sl@0
|
1227 |
close [open "globTest/weird name.c" w]
|
sl@0
|
1228 |
close [open globTest/a1/b1/x2.c w]
|
sl@0
|
1229 |
close [open globTest/a1/b2/y2.c w]
|
sl@0
|
1230 |
|
sl@0
|
1231 |
catch {close [open globTest/.1 w]}
|
sl@0
|
1232 |
catch {close [open globTest/x,z1.c w]}
|
sl@0
|
1233 |
|
sl@0
|
1234 |
test filename-11.14 {Tcl_GlobCmd} {
|
sl@0
|
1235 |
list [catch {glob ~/globTest} msg] $msg
|
sl@0
|
1236 |
} [list 0 [list [file join $env(HOME) globTest]]]
|
sl@0
|
1237 |
test filename-11.15 {Tcl_GlobCmd} {
|
sl@0
|
1238 |
list [catch {glob ~\\/globTest} msg] $msg
|
sl@0
|
1239 |
} [list 0 [list [file join $env(HOME) globTest]]]
|
sl@0
|
1240 |
test filename-11.16 {Tcl_GlobCmd} {
|
sl@0
|
1241 |
list [catch {glob globTest} msg] $msg
|
sl@0
|
1242 |
} {0 globTest}
|
sl@0
|
1243 |
|
sl@0
|
1244 |
set globname "globTest"
|
sl@0
|
1245 |
set horribleglobname "glob\[\{Test"
|
sl@0
|
1246 |
|
sl@0
|
1247 |
test filename-11.17 {Tcl_GlobCmd} {unixOnly} {
|
sl@0
|
1248 |
list [catch {lsort [glob -directory $globname *]} msg] $msg
|
sl@0
|
1249 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1250 |
[file join $globname a3]\
|
sl@0
|
1251 |
[file join $globname "weird name.c"]\
|
sl@0
|
1252 |
[file join $globname x,z1.c]\
|
sl@0
|
1253 |
[file join $globname x1.c]\
|
sl@0
|
1254 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1255 |
test filename-11.17.1 {Tcl_GlobCmd} {pcOnly macOnly} {
|
sl@0
|
1256 |
list [catch {lsort [glob -directory $globname *]} msg] $msg
|
sl@0
|
1257 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1258 |
[file join $globname .1]\
|
sl@0
|
1259 |
[file join $globname a3]\
|
sl@0
|
1260 |
[file join $globname "weird name.c"]\
|
sl@0
|
1261 |
[file join $globname x,z1.c]\
|
sl@0
|
1262 |
[file join $globname x1.c]\
|
sl@0
|
1263 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1264 |
if {[string equal $tcl_platform(platform) "windows"]} {
|
sl@0
|
1265 |
if {[string index $tcl_platform(osVersion) 0] >= 5 \
|
sl@0
|
1266 |
&& ([lindex [file system [temporaryDirectory]] 1] == "NTFS")} {
|
sl@0
|
1267 |
tcltest::testConstraint linkDirectory 1
|
sl@0
|
1268 |
} else {
|
sl@0
|
1269 |
tcltest::testConstraint linkDirectory 0
|
sl@0
|
1270 |
}
|
sl@0
|
1271 |
} elseif {[string equal $tcl_platform(osSystemName) "Symbian"]} {
|
sl@0
|
1272 |
tcltest::testConstraint linkDirectory 0
|
sl@0
|
1273 |
} else {
|
sl@0
|
1274 |
tcltest::testConstraint linkDirectory 1
|
sl@0
|
1275 |
}
|
sl@0
|
1276 |
if {[string equal $tcl_platform(platform) "windows"] || [string equal $tcl_platform(osSystemName) "Symbian"]} {
|
sl@0
|
1277 |
tcltest::testConstraint symbolicLinkFile 0
|
sl@0
|
1278 |
} else {
|
sl@0
|
1279 |
tcltest::testConstraint symbolicLinkFile 1
|
sl@0
|
1280 |
}
|
sl@0
|
1281 |
test filename-11.17.2 {Tcl_GlobCmd} {notRoot linkDirectory} {
|
sl@0
|
1282 |
set dir [pwd]
|
sl@0
|
1283 |
set ret "error in test"
|
sl@0
|
1284 |
if {[catch {
|
sl@0
|
1285 |
cd $globname
|
sl@0
|
1286 |
file link -symbolic link a1
|
sl@0
|
1287 |
cd $dir
|
sl@0
|
1288 |
set ret [list [catch {
|
sl@0
|
1289 |
lsort [glob -directory $globname -join * b1]
|
sl@0
|
1290 |
} msg] $msg]
|
sl@0
|
1291 |
}]} {
|
sl@0
|
1292 |
cd $dir
|
sl@0
|
1293 |
}
|
sl@0
|
1294 |
file delete [file join $globname link]
|
sl@0
|
1295 |
set ret
|
sl@0
|
1296 |
} [list 0 [lsort [list [file join $globname a1 b1] \
|
sl@0
|
1297 |
[file join $globname link b1]]]]
|
sl@0
|
1298 |
# Simpler version of the above test to illustrate a given bug.
|
sl@0
|
1299 |
test filename-11.17.3 {Tcl_GlobCmd} {notRoot linkDirectory} {
|
sl@0
|
1300 |
set dir [pwd]
|
sl@0
|
1301 |
set ret "error in test"
|
sl@0
|
1302 |
if {[catch {
|
sl@0
|
1303 |
cd $globname
|
sl@0
|
1304 |
file link -symbolic link a1
|
sl@0
|
1305 |
cd $dir
|
sl@0
|
1306 |
set ret [list [catch {
|
sl@0
|
1307 |
lsort [glob -directory $globname -type d *]
|
sl@0
|
1308 |
} msg] $msg]
|
sl@0
|
1309 |
}]} {
|
sl@0
|
1310 |
cd $dir
|
sl@0
|
1311 |
}
|
sl@0
|
1312 |
file delete [file join $globname link]
|
sl@0
|
1313 |
set ret
|
sl@0
|
1314 |
} [list 0 [lsort [list [file join $globname a1] \
|
sl@0
|
1315 |
[file join $globname a2] \
|
sl@0
|
1316 |
[file join $globname a3] \
|
sl@0
|
1317 |
[file join $globname link]]]]
|
sl@0
|
1318 |
# Make sure the bugfix isn't too simple. We don't want
|
sl@0
|
1319 |
# to break 'glob -type l'.
|
sl@0
|
1320 |
test filename-11.17.4 {Tcl_GlobCmd} {notRoot linkDirectory} {
|
sl@0
|
1321 |
set dir [pwd]
|
sl@0
|
1322 |
set ret "error in test"
|
sl@0
|
1323 |
if {[catch {
|
sl@0
|
1324 |
cd $globname
|
sl@0
|
1325 |
file link -symbolic link a1
|
sl@0
|
1326 |
cd $dir
|
sl@0
|
1327 |
set ret [list [catch {
|
sl@0
|
1328 |
lsort [glob -directory $globname -type l *]
|
sl@0
|
1329 |
} msg] $msg]
|
sl@0
|
1330 |
}]} {
|
sl@0
|
1331 |
cd $dir
|
sl@0
|
1332 |
}
|
sl@0
|
1333 |
file delete [file join $globname link]
|
sl@0
|
1334 |
set ret
|
sl@0
|
1335 |
} [list 0 [list [file join $globname link]]]
|
sl@0
|
1336 |
test filename-11.17.5 {Tcl_GlobCmd} {
|
sl@0
|
1337 |
list [catch {lsort [glob -directory $globname -tails *.c]} msg] $msg
|
sl@0
|
1338 |
} [list 0 [lsort [list "weird name.c" x,z1.c x1.c y1.c z1.c]]]
|
sl@0
|
1339 |
test filename-11.17.6 {Tcl_GlobCmd} {
|
sl@0
|
1340 |
list [catch {lsort [glob -directory $globname -tails *.c *.c]} msg] $msg
|
sl@0
|
1341 |
} [list 0 [lsort [concat [list "weird name.c" x,z1.c x1.c y1.c z1.c] \
|
sl@0
|
1342 |
[list "weird name.c" x,z1.c x1.c y1.c z1.c]]]]
|
sl@0
|
1343 |
test filename-11.17.7 {Tcl_GlobCmd: broken link and glob -l} {linkDirectory} {
|
sl@0
|
1344 |
set dir [pwd]
|
sl@0
|
1345 |
set ret "error in test"
|
sl@0
|
1346 |
if {[catch {
|
sl@0
|
1347 |
cd $globname
|
sl@0
|
1348 |
file mkdir nonexistent
|
sl@0
|
1349 |
file link -symbolic link nonexistent
|
sl@0
|
1350 |
file delete nonexistent
|
sl@0
|
1351 |
cd $dir
|
sl@0
|
1352 |
set ret [list [catch {
|
sl@0
|
1353 |
lsort [glob -nocomplain -directory $globname -type l *]
|
sl@0
|
1354 |
} msg] $msg]
|
sl@0
|
1355 |
}]} {
|
sl@0
|
1356 |
cd $dir
|
sl@0
|
1357 |
}
|
sl@0
|
1358 |
file delete [file join $globname link]
|
sl@0
|
1359 |
set ret
|
sl@0
|
1360 |
} [list 0 [list [file join $globname link]]]
|
sl@0
|
1361 |
test filename-11.17.8 {Tcl_GlobCmd: broken link and glob -l} {symbolicLinkFile} {
|
sl@0
|
1362 |
set dir [pwd]
|
sl@0
|
1363 |
set ret "error in test"
|
sl@0
|
1364 |
if {[catch {
|
sl@0
|
1365 |
cd $globname
|
sl@0
|
1366 |
close [open "nonexistent" w]
|
sl@0
|
1367 |
file link -symbolic link nonexistent
|
sl@0
|
1368 |
file delete nonexistent
|
sl@0
|
1369 |
cd $dir
|
sl@0
|
1370 |
set ret [list [catch {
|
sl@0
|
1371 |
lsort [glob -nocomplain -directory $globname -type l *]
|
sl@0
|
1372 |
} msg] $msg]
|
sl@0
|
1373 |
}]} {
|
sl@0
|
1374 |
cd $dir
|
sl@0
|
1375 |
}
|
sl@0
|
1376 |
file delete [file join $globname link]
|
sl@0
|
1377 |
set ret
|
sl@0
|
1378 |
} [list 0 [list [file join $globname link]]]
|
sl@0
|
1379 |
test filename-11.18 {Tcl_GlobCmd} {unixOnly} {
|
sl@0
|
1380 |
list [catch {lsort [glob -path $globname/ *]} msg] $msg
|
sl@0
|
1381 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1382 |
[file join $globname a3]\
|
sl@0
|
1383 |
[file join $globname "weird name.c"]\
|
sl@0
|
1384 |
[file join $globname x,z1.c]\
|
sl@0
|
1385 |
[file join $globname x1.c]\
|
sl@0
|
1386 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1387 |
test filename-11.18.1 {Tcl_GlobCmd} {pcOnly macOnly} {
|
sl@0
|
1388 |
list [catch {lsort [glob -path $globname/ *]} msg] $msg
|
sl@0
|
1389 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1390 |
[file join $globname .1]\
|
sl@0
|
1391 |
[file join $globname a3]\
|
sl@0
|
1392 |
[file join $globname "weird name.c"]\
|
sl@0
|
1393 |
[file join $globname x,z1.c]\
|
sl@0
|
1394 |
[file join $globname x1.c]\
|
sl@0
|
1395 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1396 |
test filename-11.19 {Tcl_GlobCmd} {unixOnly} {
|
sl@0
|
1397 |
list [catch {lsort [glob -join -path \
|
sl@0
|
1398 |
[string range $globname 0 5] * *]} msg] $msg
|
sl@0
|
1399 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1400 |
[file join $globname a3]\
|
sl@0
|
1401 |
[file join $globname "weird name.c"]\
|
sl@0
|
1402 |
[file join $globname x,z1.c]\
|
sl@0
|
1403 |
[file join $globname x1.c]\
|
sl@0
|
1404 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1405 |
test filename-11.19.1 {Tcl_GlobCmd} {pcOnly macOnly} {
|
sl@0
|
1406 |
list [catch {lsort [glob -join -path \
|
sl@0
|
1407 |
[string range $globname 0 5] * *]} msg] $msg
|
sl@0
|
1408 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1409 |
[file join $globname .1]\
|
sl@0
|
1410 |
[file join $globname a3]\
|
sl@0
|
1411 |
[file join $globname "weird name.c"]\
|
sl@0
|
1412 |
[file join $globname x,z1.c]\
|
sl@0
|
1413 |
[file join $globname x1.c]\
|
sl@0
|
1414 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1415 |
test filename-11.20 {Tcl_GlobCmd} {
|
sl@0
|
1416 |
list [catch {lsort [glob -type d -dir $globname *]} msg] $msg
|
sl@0
|
1417 |
} [list 0 [lsort [list [file join $globname a1]\
|
sl@0
|
1418 |
[file join $globname a2]\
|
sl@0
|
1419 |
[file join $globname a3]]]]
|
sl@0
|
1420 |
test filename-11.21 {Tcl_GlobCmd} {
|
sl@0
|
1421 |
list [catch {lsort [glob -type d -path $globname *]} msg] $msg
|
sl@0
|
1422 |
} [list 0 [lsort [list $globname]]]
|
sl@0
|
1423 |
|
sl@0
|
1424 |
test filename-11.21.1 {Tcl_GlobCmd} {
|
sl@0
|
1425 |
close [open {[tcl].testremains} w]
|
sl@0
|
1426 |
set res [list [catch {lsort [glob -path {[tcl]} *]} msg] $msg]
|
sl@0
|
1427 |
file delete -force {[tcl].testremains}
|
sl@0
|
1428 |
set res
|
sl@0
|
1429 |
} [list 0 {{[tcl].testremains}}]
|
sl@0
|
1430 |
|
sl@0
|
1431 |
# Get rid of file/dir if it exists, since it will have
|
sl@0
|
1432 |
# been left behind by a previous failed run.
|
sl@0
|
1433 |
if {[file exists $horribleglobname]} {
|
sl@0
|
1434 |
file delete -force $horribleglobname
|
sl@0
|
1435 |
}
|
sl@0
|
1436 |
file rename globTest $horribleglobname
|
sl@0
|
1437 |
set globname $horribleglobname
|
sl@0
|
1438 |
|
sl@0
|
1439 |
test filename-11.22 {Tcl_GlobCmd} {unixOnly} {
|
sl@0
|
1440 |
list [catch {lsort [glob -dir $globname *]} msg] $msg
|
sl@0
|
1441 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1442 |
[file join $globname a3]\
|
sl@0
|
1443 |
[file join $globname "weird name.c"]\
|
sl@0
|
1444 |
[file join $globname x,z1.c]\
|
sl@0
|
1445 |
[file join $globname x1.c]\
|
sl@0
|
1446 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1447 |
test filename-11.22.1 {Tcl_GlobCmd} {pcOnly macOnly} {
|
sl@0
|
1448 |
list [catch {lsort [glob -dir $globname *]} msg] $msg
|
sl@0
|
1449 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1450 |
[file join $globname .1]\
|
sl@0
|
1451 |
[file join $globname a3]\
|
sl@0
|
1452 |
[file join $globname "weird name.c"]\
|
sl@0
|
1453 |
[file join $globname x,z1.c]\
|
sl@0
|
1454 |
[file join $globname x1.c]\
|
sl@0
|
1455 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1456 |
test filename-11.23 {Tcl_GlobCmd} {unixOnly} {
|
sl@0
|
1457 |
list [catch {lsort [glob -path $globname/ *]} msg] $msg
|
sl@0
|
1458 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1459 |
[file join $globname a3]\
|
sl@0
|
1460 |
[file join $globname "weird name.c"]\
|
sl@0
|
1461 |
[file join $globname x,z1.c]\
|
sl@0
|
1462 |
[file join $globname x1.c]\
|
sl@0
|
1463 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1464 |
test filename-11.23.1 {Tcl_GlobCmd} {pcOnly macOnly} {
|
sl@0
|
1465 |
list [catch {lsort [glob -path $globname/ *]} msg] $msg
|
sl@0
|
1466 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1467 |
[file join $globname .1]\
|
sl@0
|
1468 |
[file join $globname a3]\
|
sl@0
|
1469 |
[file join $globname "weird name.c"]\
|
sl@0
|
1470 |
[file join $globname x,z1.c]\
|
sl@0
|
1471 |
[file join $globname x1.c]\
|
sl@0
|
1472 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1473 |
test filename-11.24 {Tcl_GlobCmd} {unixOnly} {
|
sl@0
|
1474 |
list [catch {lsort [glob -join -path \
|
sl@0
|
1475 |
[string range $globname 0 5] * *]} msg] $msg
|
sl@0
|
1476 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1477 |
[file join $globname a3]\
|
sl@0
|
1478 |
[file join $globname "weird name.c"]\
|
sl@0
|
1479 |
[file join $globname x,z1.c]\
|
sl@0
|
1480 |
[file join $globname x1.c]\
|
sl@0
|
1481 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1482 |
test filename-11.24.1 {Tcl_GlobCmd} {pcOnly macOnly} {
|
sl@0
|
1483 |
list [catch {lsort [glob -join -path \
|
sl@0
|
1484 |
[string range $globname 0 5] * *]} msg] $msg
|
sl@0
|
1485 |
} [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\
|
sl@0
|
1486 |
[file join $globname .1]\
|
sl@0
|
1487 |
[file join $globname a3]\
|
sl@0
|
1488 |
[file join $globname "weird name.c"]\
|
sl@0
|
1489 |
[file join $globname x,z1.c]\
|
sl@0
|
1490 |
[file join $globname x1.c]\
|
sl@0
|
1491 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1492 |
test filename-11.25 {Tcl_GlobCmd} {
|
sl@0
|
1493 |
list [catch {lsort [glob -type d -dir $globname *]} msg] $msg
|
sl@0
|
1494 |
} [list 0 [lsort [list [file join $globname a1]\
|
sl@0
|
1495 |
[file join $globname a2]\
|
sl@0
|
1496 |
[file join $globname a3]]]]
|
sl@0
|
1497 |
test filename-11.25.1 {Tcl_GlobCmd} {
|
sl@0
|
1498 |
list [catch {lsort [glob -type {d r} -dir $globname *]} msg] $msg
|
sl@0
|
1499 |
} [list 0 [lsort [list [file join $globname a1]\
|
sl@0
|
1500 |
[file join $globname a2]\
|
sl@0
|
1501 |
[file join $globname a3]]]]
|
sl@0
|
1502 |
test filename-11.25.2 {Tcl_GlobCmd} {
|
sl@0
|
1503 |
list [catch {lsort [glob -type {d r w} -dir $globname *]} msg] $msg
|
sl@0
|
1504 |
} [list 0 [lsort [list [file join $globname a1]\
|
sl@0
|
1505 |
[file join $globname a2]\
|
sl@0
|
1506 |
[file join $globname a3]]]]
|
sl@0
|
1507 |
test filename-11.26 {Tcl_GlobCmd} {
|
sl@0
|
1508 |
list [catch {glob -type d -path $globname *} msg] $msg
|
sl@0
|
1509 |
} [list 0 [list $globname]]
|
sl@0
|
1510 |
test filename-11.27 {Tcl_GlobCmd} {
|
sl@0
|
1511 |
list [catch {glob -types abcde *} msg] $msg
|
sl@0
|
1512 |
} {1 {bad argument to "-types": abcde}}
|
sl@0
|
1513 |
test filename-11.28 {Tcl_GlobCmd} {
|
sl@0
|
1514 |
list [catch {glob -types z *} msg] $msg
|
sl@0
|
1515 |
} {1 {bad argument to "-types": z}}
|
sl@0
|
1516 |
test filename-11.29 {Tcl_GlobCmd} {
|
sl@0
|
1517 |
list [catch {glob -types {abcd efgh} *} msg] $msg
|
sl@0
|
1518 |
} {1 {only one MacOS type or creator argument to "-types" allowed}}
|
sl@0
|
1519 |
test filename-11.30 {Tcl_GlobCmd} {
|
sl@0
|
1520 |
list [catch {glob -types {{macintosh type TEXT} \
|
sl@0
|
1521 |
{macintosh creator ALFA} efgh} *} msg] $msg
|
sl@0
|
1522 |
} {1 {only one MacOS type or creator argument to "-types" allowed}}
|
sl@0
|
1523 |
test filename-11.31 {Tcl_GlobCmd} {
|
sl@0
|
1524 |
list [catch {glob -types} msg] $msg
|
sl@0
|
1525 |
} {1 {missing argument to "-types"}}
|
sl@0
|
1526 |
test filename-11.32 {Tcl_GlobCmd} {
|
sl@0
|
1527 |
list [catch {glob -path hello -dir hello *} msg] $msg
|
sl@0
|
1528 |
} {1 {"-directory" cannot be used with "-path"}}
|
sl@0
|
1529 |
test filename-11.33 {Tcl_GlobCmd} {
|
sl@0
|
1530 |
list [catch {glob -path} msg] $msg
|
sl@0
|
1531 |
} {1 {missing argument to "-path"}}
|
sl@0
|
1532 |
test filename-11.34 {Tcl_GlobCmd} {
|
sl@0
|
1533 |
list [catch {glob -direct} msg] $msg
|
sl@0
|
1534 |
} {1 {missing argument to "-directory"}}
|
sl@0
|
1535 |
test filename-11.35 {Tcl_GlobCmd} {
|
sl@0
|
1536 |
list [catch {glob -paths *} msg] $msg
|
sl@0
|
1537 |
} {1 {bad option "-paths": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}}
|
sl@0
|
1538 |
# Test '-tails' flag to glob.
|
sl@0
|
1539 |
test filename-11.36 {Tcl_GlobCmd} {
|
sl@0
|
1540 |
list [catch {glob -tails *} msg] $msg
|
sl@0
|
1541 |
} {1 {"-tails" must be used with either "-directory" or "-path"}}
|
sl@0
|
1542 |
test filename-11.37 {Tcl_GlobCmd} {
|
sl@0
|
1543 |
list [catch {glob -type d -tails -path $globname *} msg] $msg
|
sl@0
|
1544 |
} [list 0 [list $globname]]
|
sl@0
|
1545 |
test filename-11.38 {Tcl_GlobCmd} {
|
sl@0
|
1546 |
list [catch {glob -tails -path $globname *} msg] $msg
|
sl@0
|
1547 |
} [list 0 [list $globname]]
|
sl@0
|
1548 |
test filename-11.39 {Tcl_GlobCmd} {
|
sl@0
|
1549 |
list [catch {glob -tails -join -path $globname *} msg] $msg
|
sl@0
|
1550 |
} [list 0 [list $globname]]
|
sl@0
|
1551 |
test filename-11.40 {Tcl_GlobCmd} {
|
sl@0
|
1552 |
expr {[glob -dir [pwd] -tails *] == [glob *]}
|
sl@0
|
1553 |
} {1}
|
sl@0
|
1554 |
test filename-11.41 {Tcl_GlobCmd} {
|
sl@0
|
1555 |
expr {[glob -dir [pwd] -tails *] != [glob -dir [pwd] *]}
|
sl@0
|
1556 |
} {1}
|
sl@0
|
1557 |
test filename-11.42 {Tcl_GlobCmd} {
|
sl@0
|
1558 |
set res [list]
|
sl@0
|
1559 |
foreach f [glob -dir [pwd] *] {
|
sl@0
|
1560 |
lappend res [file tail $f]
|
sl@0
|
1561 |
}
|
sl@0
|
1562 |
expr {$res == [glob *]}
|
sl@0
|
1563 |
} {1}
|
sl@0
|
1564 |
test filename-11.43 {Tcl_GlobCmd} {
|
sl@0
|
1565 |
list [catch {glob -t *} msg] $msg
|
sl@0
|
1566 |
} {1 {ambiguous option "-t": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}}
|
sl@0
|
1567 |
test filename-11.44 {Tcl_GlobCmd} {
|
sl@0
|
1568 |
list [catch {glob -tails -path hello -directory hello *} msg] $msg
|
sl@0
|
1569 |
} {1 {"-directory" cannot be used with "-path"}}
|
sl@0
|
1570 |
test filename-11.45 {Tcl_GlobCmd on root volume} {
|
sl@0
|
1571 |
set res1 ""
|
sl@0
|
1572 |
set res2 ""
|
sl@0
|
1573 |
catch {
|
sl@0
|
1574 |
set res1 [glob -dir [lindex [file volumes] 0] -tails *]
|
sl@0
|
1575 |
}
|
sl@0
|
1576 |
catch {
|
sl@0
|
1577 |
set tmpd [pwd]
|
sl@0
|
1578 |
cd [lindex [file volumes] 0]
|
sl@0
|
1579 |
set res2 [glob *]
|
sl@0
|
1580 |
cd $tmpd
|
sl@0
|
1581 |
}
|
sl@0
|
1582 |
expr {$res1 == $res2}
|
sl@0
|
1583 |
} {1}
|
sl@0
|
1584 |
test filename-11.46 {Tcl_GlobCmd} {
|
sl@0
|
1585 |
list [catch {glob -types abcde -dir foo *} msg] $msg
|
sl@0
|
1586 |
} {1 {bad argument to "-types": abcde}}
|
sl@0
|
1587 |
test filename-11.47 {Tcl_GlobCmd} {
|
sl@0
|
1588 |
list [catch {glob -types abcde -path foo *} msg] $msg
|
sl@0
|
1589 |
} {1 {bad argument to "-types": abcde}}
|
sl@0
|
1590 |
test filename-11.48 {Tcl_GlobCmd} {
|
sl@0
|
1591 |
list [catch {glob -types abcde -dir foo -join * *} msg] $msg
|
sl@0
|
1592 |
} {1 {bad argument to "-types": abcde}}
|
sl@0
|
1593 |
test filename-11.49 {Tcl_GlobCmd} {
|
sl@0
|
1594 |
list [catch {glob -types abcde -path foo -join * *} msg] $msg
|
sl@0
|
1595 |
} {1 {bad argument to "-types": abcde}}
|
sl@0
|
1596 |
|
sl@0
|
1597 |
file rename $horribleglobname globTest
|
sl@0
|
1598 |
set globname globTest
|
sl@0
|
1599 |
unset horribleglobname
|
sl@0
|
1600 |
|
sl@0
|
1601 |
test filename-12.1 {simple globbing} {unixOrPc} {
|
sl@0
|
1602 |
list [catch {glob {}} msg] $msg
|
sl@0
|
1603 |
} {0 .}
|
sl@0
|
1604 |
test filename-12.1.1 {simple globbing} {unixOrPc} {
|
sl@0
|
1605 |
list [catch {glob -types f {}} msg] $msg
|
sl@0
|
1606 |
} {1 {no files matched glob pattern ""}}
|
sl@0
|
1607 |
test filename-12.1.2 {simple globbing} {unixOrPc} {
|
sl@0
|
1608 |
list [catch {glob -types d {}} msg] $msg
|
sl@0
|
1609 |
} {0 .}
|
sl@0
|
1610 |
test filename-12.1.3 {simple globbing} {unixOnly} {
|
sl@0
|
1611 |
list [catch {glob -types hidden {}} msg] $msg
|
sl@0
|
1612 |
} {0 .}
|
sl@0
|
1613 |
test filename-12.1.4 {simple globbing} {pcOnly} {
|
sl@0
|
1614 |
list [catch {glob -types hidden {}} msg] $msg
|
sl@0
|
1615 |
} {1 {no files matched glob pattern ""}}
|
sl@0
|
1616 |
test filename-12.1.5 {simple globbing} {pcOnly} {
|
sl@0
|
1617 |
list [catch {glob -types hidden c:/} msg] $msg
|
sl@0
|
1618 |
} {1 {no files matched glob pattern "c:/"}}
|
sl@0
|
1619 |
test filename-12.1.6 {simple globbing} {pcOnly} {
|
sl@0
|
1620 |
list [catch {glob c:/} msg] $msg
|
sl@0
|
1621 |
} {0 c:/}
|
sl@0
|
1622 |
test filename-12.2 {simple globbing} {macOnly} {
|
sl@0
|
1623 |
list [catch {glob {}} msg] $msg
|
sl@0
|
1624 |
} {0 :}
|
sl@0
|
1625 |
test filename-12.2.1 {simple globbing} {macOnly} {
|
sl@0
|
1626 |
list [catch {glob -types f {}} msg] $msg
|
sl@0
|
1627 |
} {1 {no files matched glob pattern ""}}
|
sl@0
|
1628 |
test filename-12.2.2 {simple globbing} {macOnly} {
|
sl@0
|
1629 |
list [catch {glob -types d {}} msg] $msg
|
sl@0
|
1630 |
} {0 :}
|
sl@0
|
1631 |
test filename-12.2.3 {simple globbing} {macOnly} {
|
sl@0
|
1632 |
list [catch {glob -types hidden {}} msg] $msg
|
sl@0
|
1633 |
} {1 {no files matched glob pattern ""}}
|
sl@0
|
1634 |
test filename-12.3 {simple globbing} {
|
sl@0
|
1635 |
list [catch {glob -nocomplain \{a1,a2\}} msg] $msg
|
sl@0
|
1636 |
} {0 {}}
|
sl@0
|
1637 |
|
sl@0
|
1638 |
if {$tcl_platform(platform) == "macintosh"} {
|
sl@0
|
1639 |
set globPreResult :globTest:
|
sl@0
|
1640 |
} else {
|
sl@0
|
1641 |
set globPreResult globTest/
|
sl@0
|
1642 |
}
|
sl@0
|
1643 |
set x1 x1.c
|
sl@0
|
1644 |
set y1 y1.c
|
sl@0
|
1645 |
test filename-12.4 {simple globbing} {unixOrPc} {
|
sl@0
|
1646 |
lsort [glob globTest/x1.c globTest/y1.c globTest/foo]
|
sl@0
|
1647 |
} "$globPreResult$x1 $globPreResult$y1"
|
sl@0
|
1648 |
test filename-12.5 {simple globbing} {
|
sl@0
|
1649 |
list [catch {glob globTest\\/x1.c} msg] $msg
|
sl@0
|
1650 |
} "0 $globPreResult$x1"
|
sl@0
|
1651 |
test filename-12.6 {simple globbing} {
|
sl@0
|
1652 |
list [catch {glob globTest\\/\\x1.c} msg] $msg
|
sl@0
|
1653 |
} "0 $globPreResult$x1"
|
sl@0
|
1654 |
test filename-12.7 {globbing at filesystem root} {unixOnly} {
|
sl@0
|
1655 |
set res1 [glob -nocomplain /*]
|
sl@0
|
1656 |
set res2 [glob -path / *]
|
sl@0
|
1657 |
set equal [string equal $res1 $res2]
|
sl@0
|
1658 |
if {!$equal} {
|
sl@0
|
1659 |
lappend equal "not equal" $res1 $res2
|
sl@0
|
1660 |
}
|
sl@0
|
1661 |
set equal
|
sl@0
|
1662 |
} {1}
|
sl@0
|
1663 |
test filename-12.8 {globbing at filesystem root} {unixOnly} {
|
sl@0
|
1664 |
set dir [lindex [glob -type d /*] 0]
|
sl@0
|
1665 |
set first [string range $dir 0 1]
|
sl@0
|
1666 |
set res1 [glob -nocomplain ${first}*]
|
sl@0
|
1667 |
set res2 [glob -path $first *]
|
sl@0
|
1668 |
set equal [string equal $res1 $res2]
|
sl@0
|
1669 |
if {!$equal} {
|
sl@0
|
1670 |
lappend equal "not equal" $res1 $res2
|
sl@0
|
1671 |
}
|
sl@0
|
1672 |
set equal
|
sl@0
|
1673 |
} {1}
|
sl@0
|
1674 |
test filename-12.9 {globbing at filesystem root} {winOnly} {
|
sl@0
|
1675 |
# Can't grab just anything from 'file volumes' because we need a dir
|
sl@0
|
1676 |
# that has subdirs - assume that C:/ exists across Windows machines.
|
sl@0
|
1677 |
set dir [lindex [glob -type d C:/*] 0]
|
sl@0
|
1678 |
set first [string range $dir 0 3]
|
sl@0
|
1679 |
set res1 [glob -nocomplain ${first}*]
|
sl@0
|
1680 |
set res2 [glob -path $first *]
|
sl@0
|
1681 |
set equal [string equal $res1 $res2]
|
sl@0
|
1682 |
if {!$equal} {
|
sl@0
|
1683 |
lappend equal "not equal" $res1 $res2
|
sl@0
|
1684 |
}
|
sl@0
|
1685 |
set equal
|
sl@0
|
1686 |
} {1}
|
sl@0
|
1687 |
|
sl@0
|
1688 |
test filename-13.1 {globbing with brace substitution} {
|
sl@0
|
1689 |
list [catch {glob globTest/\{\}} msg] $msg
|
sl@0
|
1690 |
} "0 $globPreResult"
|
sl@0
|
1691 |
test filename-13.2 {globbing with brace substitution} {
|
sl@0
|
1692 |
list [catch {glob globTest/\{} msg] $msg
|
sl@0
|
1693 |
} {1 {unmatched open-brace in file name}}
|
sl@0
|
1694 |
test filename-13.3 {globbing with brace substitution} {
|
sl@0
|
1695 |
list [catch {glob globTest/\{\\\}} msg] $msg
|
sl@0
|
1696 |
} {1 {unmatched open-brace in file name}}
|
sl@0
|
1697 |
test filename-13.4 {globbing with brace substitution} {
|
sl@0
|
1698 |
list [catch {glob globTest/\{\\} msg] $msg
|
sl@0
|
1699 |
} {1 {unmatched open-brace in file name}}
|
sl@0
|
1700 |
test filename-13.5 {globbing with brace substitution} {
|
sl@0
|
1701 |
list [catch {glob globTest/\}} msg] $msg
|
sl@0
|
1702 |
} {1 {unmatched close-brace in file name}}
|
sl@0
|
1703 |
test filename-13.6 {globbing with brace substitution} {
|
sl@0
|
1704 |
list [catch {glob globTest/\{\}x1.c} msg] $msg
|
sl@0
|
1705 |
} "0 $globPreResult$x1"
|
sl@0
|
1706 |
test filename-13.7 {globbing with brace substitution} {
|
sl@0
|
1707 |
list [catch {glob globTest/\{x\}1.c} msg] $msg
|
sl@0
|
1708 |
} "0 $globPreResult$x1"
|
sl@0
|
1709 |
test filename-13.8 {globbing with brace substitution} {
|
sl@0
|
1710 |
list [catch {glob globTest/\{x\{\}\}1.c} msg] $msg
|
sl@0
|
1711 |
} "0 $globPreResult$x1"
|
sl@0
|
1712 |
test filename-13.9 {globbing with brace substitution} {
|
sl@0
|
1713 |
list [lsort [catch {glob globTest/\{x,y\}1.c} msg]] $msg
|
sl@0
|
1714 |
} [list 0 [list $globPreResult$x1 $globPreResult$y1]]
|
sl@0
|
1715 |
test filename-13.10 {globbing with brace substitution} {
|
sl@0
|
1716 |
list [lsort [catch {glob globTest/\{x,,y\}1.c} msg]] $msg
|
sl@0
|
1717 |
} [list 0 [list $globPreResult$x1 $globPreResult$y1]]
|
sl@0
|
1718 |
test filename-13.11 {globbing with brace substitution} {unixOrPc} {
|
sl@0
|
1719 |
list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg
|
sl@0
|
1720 |
} {0 {globTest/x1.c globTest/x,z1.c globTest/z1.c}}
|
sl@0
|
1721 |
test filename-13.12 {globbing with brace substitution} {macOnly} {
|
sl@0
|
1722 |
list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg
|
sl@0
|
1723 |
} {0 {:globTest:x1.c :globTest:x,z1.c :globTest:z1.c}}
|
sl@0
|
1724 |
test filename-13.13 {globbing with brace substitution} {
|
sl@0
|
1725 |
lsort [glob globTest/{a,b,x,y}1.c]
|
sl@0
|
1726 |
} [list $globPreResult$x1 $globPreResult$y1]
|
sl@0
|
1727 |
test filename-13.14 {globbing with brace substitution} {unixOrPc} {
|
sl@0
|
1728 |
lsort [glob {globTest/{x1,y2,weird name}.c}]
|
sl@0
|
1729 |
} {{globTest/weird name.c} globTest/x1.c}
|
sl@0
|
1730 |
test filename-13.15 {globbing with brace substitution} {macOnly} {
|
sl@0
|
1731 |
lsort [glob {globTest/{x1,y2,weird name}.c}]
|
sl@0
|
1732 |
} {{:globTest:weird name.c} :globTest:x1.c}
|
sl@0
|
1733 |
test filename-13.16 {globbing with brace substitution} {unixOrPc} {
|
sl@0
|
1734 |
lsort [glob globTest/{x1.c,a1/*}]
|
sl@0
|
1735 |
} {globTest/a1/b1 globTest/a1/b2 globTest/x1.c}
|
sl@0
|
1736 |
test filename-13.17 {globbing with brace substitution} {macOnly} {
|
sl@0
|
1737 |
lsort [glob globTest/{x1.c,a1/*}]
|
sl@0
|
1738 |
} {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c}
|
sl@0
|
1739 |
test filename-13.18 {globbing with brace substitution} {unixOrPc} {
|
sl@0
|
1740 |
lsort [glob globTest/{x1.c,{a},a1/*}]
|
sl@0
|
1741 |
} {globTest/a1/b1 globTest/a1/b2 globTest/x1.c}
|
sl@0
|
1742 |
test filename-13.19 {globbing with brace substitution} {macOnly} {
|
sl@0
|
1743 |
lsort [glob globTest/{x1.c,{a},a1/*}]
|
sl@0
|
1744 |
} {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c}
|
sl@0
|
1745 |
test filename-13.20 {globbing with brace substitution} {unixOrPc} {
|
sl@0
|
1746 |
lsort [glob globTest/{a,x}1/*/{x,y}*]
|
sl@0
|
1747 |
} {globTest/a1/b1/x2.c globTest/a1/b2/y2.c}
|
sl@0
|
1748 |
test filename-13.21 {globbing with brace substitution} {macOnly} {
|
sl@0
|
1749 |
lsort [glob globTest/{a,x}1/*/{x,y}*]
|
sl@0
|
1750 |
} {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c}
|
sl@0
|
1751 |
test filename-13.22 {globbing with brace substitution} {
|
sl@0
|
1752 |
list [catch {glob globTest/\{a,x\}1/*/\{} msg] $msg
|
sl@0
|
1753 |
} {1 {unmatched open-brace in file name}}
|
sl@0
|
1754 |
|
sl@0
|
1755 |
test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1756 |
lsort [glob glo*/*.c]
|
sl@0
|
1757 |
} {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}
|
sl@0
|
1758 |
test filename-14.2 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1759 |
lsort [glob glo*/*.c]
|
sl@0
|
1760 |
} {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c}
|
sl@0
|
1761 |
test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1762 |
lsort [glob globTest/?1.c]
|
sl@0
|
1763 |
} {globTest/x1.c globTest/y1.c globTest/z1.c}
|
sl@0
|
1764 |
test filename-14.4 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1765 |
lsort [glob globTest/?1.c]
|
sl@0
|
1766 |
} {:globTest:x1.c :globTest:y1.c :globTest:z1.c}
|
sl@0
|
1767 |
|
sl@0
|
1768 |
# The current directory could be anywhere; do this to stop spurious matches
|
sl@0
|
1769 |
file mkdir globTestContext
|
sl@0
|
1770 |
file rename globTest [file join globTestContext globTest]
|
sl@0
|
1771 |
set savepwd [pwd]
|
sl@0
|
1772 |
cd globTestContext
|
sl@0
|
1773 |
|
sl@0
|
1774 |
test filename-14.5 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1775 |
lsort [glob */*/*/*.c]
|
sl@0
|
1776 |
} {globTest/a1/b1/x2.c globTest/a1/b2/y2.c}
|
sl@0
|
1777 |
test filename-14.6 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1778 |
lsort [glob */*/*/*.c]
|
sl@0
|
1779 |
} {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c}
|
sl@0
|
1780 |
|
sl@0
|
1781 |
# Reset to where we were
|
sl@0
|
1782 |
cd $savepwd
|
sl@0
|
1783 |
file rename [file join globTestContext globTest] globTest
|
sl@0
|
1784 |
file delete globTestContext
|
sl@0
|
1785 |
|
sl@0
|
1786 |
test filename-14.7 {asterisks, question marks, and brackets} {unixOnly} {
|
sl@0
|
1787 |
lsort [glob globTest/*]
|
sl@0
|
1788 |
} {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
|
1789 |
test filename-14.7.1 {asterisks, question marks, and brackets} {pcOnly} {
|
sl@0
|
1790 |
lsort [glob globTest/*]
|
sl@0
|
1791 |
} {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
|
1792 |
test filename-14.8 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1793 |
lsort [glob globTest/*]
|
sl@0
|
1794 |
} {: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
|
1795 |
test filename-14.9.1 {asterisks, question marks, and brackets} {unixOrPc tempNotSymbian} {
|
sl@0
|
1796 |
lsort [glob globTest/.*]
|
sl@0
|
1797 |
} {globTest/. globTest/.. globTest/.1}
|
sl@0
|
1798 |
test filename-14.9.2 {asterisks, question marks, and brackets} {symbianOnly} {
|
sl@0
|
1799 |
lsort [glob globTest/.*]
|
sl@0
|
1800 |
} {globTest/.1}
|
sl@0
|
1801 |
test filename-14.10 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1802 |
lsort [glob globTest/.*]
|
sl@0
|
1803 |
} {:globTest:.1}
|
sl@0
|
1804 |
test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1805 |
lsort [glob globTest/*/*]
|
sl@0
|
1806 |
} {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3}
|
sl@0
|
1807 |
test filename-14.12 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1808 |
lsort [glob globTest/*/*]
|
sl@0
|
1809 |
} {:globTest:a1:b1 :globTest:a1:b2 :globTest:a2:b3}
|
sl@0
|
1810 |
test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1811 |
lsort [glob {globTest/[xyab]1.*}]
|
sl@0
|
1812 |
} {globTest/x1.c globTest/y1.c}
|
sl@0
|
1813 |
test filename-14.14 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1814 |
lsort [glob {globTest/[xyab]1.*}]
|
sl@0
|
1815 |
} {:globTest:x1.c :globTest:y1.c}
|
sl@0
|
1816 |
test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1817 |
lsort [glob globTest/*/]
|
sl@0
|
1818 |
} {globTest/a1/ globTest/a2/ globTest/a3/}
|
sl@0
|
1819 |
test filename-14.16 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1820 |
lsort [glob globTest/*/]
|
sl@0
|
1821 |
} {:globTest:a1: :globTest:a2: :globTest:a3:}
|
sl@0
|
1822 |
test filename-14.17 {asterisks, question marks, and brackets} {
|
sl@0
|
1823 |
global env
|
sl@0
|
1824 |
set temp $env(HOME)
|
sl@0
|
1825 |
set env(HOME) [file join $env(HOME) globTest]
|
sl@0
|
1826 |
set result [list [catch {glob ~/z*} msg] $msg]
|
sl@0
|
1827 |
set env(HOME) $temp
|
sl@0
|
1828 |
set result
|
sl@0
|
1829 |
} [list 0 [list [file join $env(HOME) globTest z1.c]]]
|
sl@0
|
1830 |
test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} {
|
sl@0
|
1831 |
list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg
|
sl@0
|
1832 |
} {0 {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}}
|
sl@0
|
1833 |
test filename-14.19 {asterisks, question marks, and brackets} {macOnly} {
|
sl@0
|
1834 |
list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg
|
sl@0
|
1835 |
} {0 {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c}}
|
sl@0
|
1836 |
test filename-14.20 {asterisks, question marks, and brackets} {
|
sl@0
|
1837 |
list [catch {glob -nocomplain goo/*} msg] $msg
|
sl@0
|
1838 |
} {0 {}}
|
sl@0
|
1839 |
test filename-14.21 {asterisks, question marks, and brackets} {
|
sl@0
|
1840 |
list [catch {glob globTest/*/gorp} msg] $msg
|
sl@0
|
1841 |
} {1 {no files matched glob pattern "globTest/*/gorp"}}
|
sl@0
|
1842 |
test filename-14.22 {asterisks, question marks, and brackets} {
|
sl@0
|
1843 |
list [catch {glob goo/* x*z foo?q} msg] $msg
|
sl@0
|
1844 |
} {1 {no files matched glob patterns "goo/* x*z foo?q"}}
|
sl@0
|
1845 |
test filename-14.23 {slash globbing} {unixOrPc} {
|
sl@0
|
1846 |
glob /
|
sl@0
|
1847 |
} /
|
sl@0
|
1848 |
test filename-14.24 {slash globbing} {pcOnly} {
|
sl@0
|
1849 |
glob {\\}
|
sl@0
|
1850 |
} /
|
sl@0
|
1851 |
test filename-14.25 {type specific globbing} {unixOnly} {
|
sl@0
|
1852 |
list [catch {lsort [glob -dir globTest -types f *]} msg] $msg
|
sl@0
|
1853 |
} [list 0 [lsort [list \
|
sl@0
|
1854 |
[file join $globname "weird name.c"]\
|
sl@0
|
1855 |
[file join $globname x,z1.c]\
|
sl@0
|
1856 |
[file join $globname x1.c]\
|
sl@0
|
1857 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1858 |
test filename-14.25.1 {type specific globbing} {pcOnly macOnly} {
|
sl@0
|
1859 |
list [catch {lsort [glob -dir globTest -types f *]} msg] $msg
|
sl@0
|
1860 |
} [list 0 [lsort [list \
|
sl@0
|
1861 |
[file join $globname .1]\
|
sl@0
|
1862 |
[file join $globname "weird name.c"]\
|
sl@0
|
1863 |
[file join $globname x,z1.c]\
|
sl@0
|
1864 |
[file join $globname x1.c]\
|
sl@0
|
1865 |
[file join $globname y1.c] [file join $globname z1.c]]]]
|
sl@0
|
1866 |
test filename-14.26 {type specific globbing} {
|
sl@0
|
1867 |
list [catch {glob -nocomplain -dir globTest -types {readonly} *} msg] $msg
|
sl@0
|
1868 |
} [list 0 {}]
|
sl@0
|
1869 |
|
sl@0
|
1870 |
unset globname
|
sl@0
|
1871 |
|
sl@0
|
1872 |
# The following tests are only valid for Unix systems.
|
sl@0
|
1873 |
# On some systems, like AFS, "000" protection doesn't prevent
|
sl@0
|
1874 |
# access by owner, so the following test is not portable.
|
sl@0
|
1875 |
|
sl@0
|
1876 |
catch {file attributes globTest/a1 -permissions 0000}
|
sl@0
|
1877 |
test filename-15.1 {unix specific globbing} {unixOnly nonPortable} {
|
sl@0
|
1878 |
string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode]
|
sl@0
|
1879 |
} {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}}
|
sl@0
|
1880 |
test filename-15.2 {unix specific no complain: no errors} {unixOnly nonPortable} {
|
sl@0
|
1881 |
glob -nocomplain globTest/a1/*
|
sl@0
|
1882 |
} {}
|
sl@0
|
1883 |
test filename-15.3 {unix specific no complain: no errors, good result} \
|
sl@0
|
1884 |
{unixOnly nonPortable} {
|
sl@0
|
1885 |
# test fails because if an error occur , the interp's result
|
sl@0
|
1886 |
# is reset...
|
sl@0
|
1887 |
glob -nocomplain globTest/a2 globTest/a1/* globTest/a3
|
sl@0
|
1888 |
} {globTest/a2 globTest/a3}
|
sl@0
|
1889 |
|
sl@0
|
1890 |
catch {file attributes globTest/a1 -permissions 0755}
|
sl@0
|
1891 |
test filename-15.4 {unix specific no complain: no errors, good result} \
|
sl@0
|
1892 |
{unixOnly nonPortable} {
|
sl@0
|
1893 |
# test fails because if an error occurs, the interp's result
|
sl@0
|
1894 |
# is reset... or you don't run at scriptics where the
|
sl@0
|
1895 |
# outser and welch users exists
|
sl@0
|
1896 |
glob -nocomplain ~ouster ~foo ~welch
|
sl@0
|
1897 |
} {/home/ouster /home/welch}
|
sl@0
|
1898 |
test filename-15.4.1 {no complain: no errors, good result} {
|
sl@0
|
1899 |
# test used to fail because if an error occurs, the interp's result
|
sl@0
|
1900 |
# is reset...
|
sl@0
|
1901 |
string equal [glob -nocomplain ~wontexist ~blah ~] \
|
sl@0
|
1902 |
[glob -nocomplain ~ ~blah ~wontexist]
|
sl@0
|
1903 |
} {1}
|
sl@0
|
1904 |
test filename-15.5 {unix specific globbing} {unixOnly nonPortable} {
|
sl@0
|
1905 |
glob ~ouster/.csh*
|
sl@0
|
1906 |
} "/home/ouster/.cshrc"
|
sl@0
|
1907 |
catch {close [open globTest/odd\\\[\]*?\{\}name w]}
|
sl@0
|
1908 |
test filename-15.6 {unix specific globbing} {unixOnly tempNotSymbian} {
|
sl@0
|
1909 |
global env
|
sl@0
|
1910 |
set temp $env(HOME)
|
sl@0
|
1911 |
set env(HOME) $env(HOME)/globTest/odd\\\[\]*?\{\}name
|
sl@0
|
1912 |
set result [list [catch {glob ~} msg] $msg]
|
sl@0
|
1913 |
set env(HOME) $temp
|
sl@0
|
1914 |
set result
|
sl@0
|
1915 |
} [list 0 [list [lindex [glob ~] 0]/globTest/odd\\\[\]*?\{\}name]]
|
sl@0
|
1916 |
catch {file delete -force globTest/odd\\\[\]*?\{\}name}
|
sl@0
|
1917 |
|
sl@0
|
1918 |
# The following tests are only valid for Windows systems.
|
sl@0
|
1919 |
set oldDir [pwd]
|
sl@0
|
1920 |
if {$::tcltest::testConstraints(pcOnly)} {
|
sl@0
|
1921 |
cd c:/
|
sl@0
|
1922 |
file delete -force globTest
|
sl@0
|
1923 |
file mkdir globTest
|
sl@0
|
1924 |
close [open globTest/x1.BAT w]
|
sl@0
|
1925 |
close [open globTest/y1.Bat w]
|
sl@0
|
1926 |
close [open globTest/z1.bat w]
|
sl@0
|
1927 |
}
|
sl@0
|
1928 |
|
sl@0
|
1929 |
test filename-16.1 {windows specific globbing} {pcOnly} {
|
sl@0
|
1930 |
lsort [glob globTest/*.bat]
|
sl@0
|
1931 |
} {globTest/x1.BAT globTest/y1.Bat globTest/z1.bat}
|
sl@0
|
1932 |
test filename-16.2 {windows specific globbing} {pcOnly} {
|
sl@0
|
1933 |
glob c:
|
sl@0
|
1934 |
} c:
|
sl@0
|
1935 |
test filename-16.3 {windows specific globbing} {pcOnly} {
|
sl@0
|
1936 |
glob c:\\\\
|
sl@0
|
1937 |
} c:/
|
sl@0
|
1938 |
test filename-16.4 {windows specific globbing} {pcOnly} {
|
sl@0
|
1939 |
glob c:/
|
sl@0
|
1940 |
} c:/
|
sl@0
|
1941 |
test filename-16.5 {windows specific globbing} {pcOnly} {
|
sl@0
|
1942 |
glob c:*bTest
|
sl@0
|
1943 |
} c:globTest
|
sl@0
|
1944 |
test filename-16.6 {windows specific globbing} {pcOnly} {
|
sl@0
|
1945 |
glob c:\\\\*bTest
|
sl@0
|
1946 |
} c:/globTest
|
sl@0
|
1947 |
test filename-16.7 {windows specific globbing} {pcOnly} {
|
sl@0
|
1948 |
glob c:/*bTest
|
sl@0
|
1949 |
} c:/globTest
|
sl@0
|
1950 |
test filename-16.8 {windows specific globbing} {pcOnly} {
|
sl@0
|
1951 |
lsort [glob c:globTest/*.bat]
|
sl@0
|
1952 |
} {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat}
|
sl@0
|
1953 |
test filename-16.9 {windows specific globbing} {pcOnly} {
|
sl@0
|
1954 |
lsort [glob c:/globTest/*.bat]
|
sl@0
|
1955 |
} {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat}
|
sl@0
|
1956 |
test filename-16.10 {windows specific globbing} {pcOnly} {
|
sl@0
|
1957 |
lsort [glob c:globTest\\\\*.bat]
|
sl@0
|
1958 |
} {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat}
|
sl@0
|
1959 |
test filename-16.11 {windows specific globbing} {pcOnly} {
|
sl@0
|
1960 |
lsort [glob c:\\\\globTest\\\\*.bat]
|
sl@0
|
1961 |
} {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat}
|
sl@0
|
1962 |
|
sl@0
|
1963 |
# some tests require a shared C drive
|
sl@0
|
1964 |
|
sl@0
|
1965 |
if {[catch {cd //[info hostname]/c}]} {
|
sl@0
|
1966 |
set ::tcltest::testConstraints(sharedCdrive) 0
|
sl@0
|
1967 |
} else {
|
sl@0
|
1968 |
set ::tcltest::testConstraints(sharedCdrive) 1
|
sl@0
|
1969 |
}
|
sl@0
|
1970 |
|
sl@0
|
1971 |
test filename-16.12 {windows specific globbing} {pcOnly sharedCdrive} {
|
sl@0
|
1972 |
cd //[info hostname]/c
|
sl@0
|
1973 |
glob //[info hostname]/c/*Test
|
sl@0
|
1974 |
} //[info hostname]/c/globTest
|
sl@0
|
1975 |
test filename-16.13 {windows specific globbing} {pcOnly sharedCdrive} {
|
sl@0
|
1976 |
cd //[info hostname]/c
|
sl@0
|
1977 |
glob "\\\\\\\\[info hostname]\\\\c\\\\*Test"
|
sl@0
|
1978 |
} //[info hostname]/c/globTest
|
sl@0
|
1979 |
test filename-16.14 {windows specific globbing} {pcOnly} {
|
sl@0
|
1980 |
cd [lindex [glob -types d -dir C:/ *] 0]
|
sl@0
|
1981 |
expr {[lsearch -exact [glob {{.,*}*}] ".."] != -1}
|
sl@0
|
1982 |
} {1}
|
sl@0
|
1983 |
test filename-16.15 {windows specific globbing} {pcOnly} {
|
sl@0
|
1984 |
cd [lindex [glob -types d -dir C:/ *] 0]
|
sl@0
|
1985 |
glob ..
|
sl@0
|
1986 |
} {..}
|
sl@0
|
1987 |
test filename-16.16 {windows specific globbing} {pcOnly} {
|
sl@0
|
1988 |
file tail [lindex [glob "[lindex [glob -types d -dir C:/ *] 0]/.."] 0]
|
sl@0
|
1989 |
} {..}
|
sl@0
|
1990 |
|
sl@0
|
1991 |
test filename-17.1 {windows specific special files} {testsetplatform} {
|
sl@0
|
1992 |
testsetplatform win
|
sl@0
|
1993 |
list [file pathtype com1] [file pathtype con] [file pathtype lpt3] \
|
sl@0
|
1994 |
[file pathtype prn] [file pathtype nul] [file pathtype aux] \
|
sl@0
|
1995 |
[file pathtype foo]
|
sl@0
|
1996 |
} {absolute absolute absolute absolute absolute absolute relative}
|
sl@0
|
1997 |
|
sl@0
|
1998 |
test filename-17.2 {windows specific glob with executable} {winOnly} {
|
sl@0
|
1999 |
makeDirectory execglob
|
sl@0
|
2000 |
makeFile contents execglob/abc.exe
|
sl@0
|
2001 |
makeFile contents execglob/abc.notexecutable
|
sl@0
|
2002 |
set res [glob -nocomplain -dir [temporaryDirectory]/execglob \
|
sl@0
|
2003 |
-tails -types x *]
|
sl@0
|
2004 |
removeFile execglob/abc.exe
|
sl@0
|
2005 |
removeFile execglob/abc.notexecutable
|
sl@0
|
2006 |
removeDirectory execglob
|
sl@0
|
2007 |
set res
|
sl@0
|
2008 |
} {abc.exe}
|
sl@0
|
2009 |
|
sl@0
|
2010 |
test fileName-18.1 {windows - split ADS name correctly} {winOnly} {
|
sl@0
|
2011 |
# bug 1194458
|
sl@0
|
2012 |
set x [file split c:/c:d]
|
sl@0
|
2013 |
set y [eval [linsert $x 0 file join]]
|
sl@0
|
2014 |
list $x $y
|
sl@0
|
2015 |
} {{c:/ ./c:d} c:/c:d}
|
sl@0
|
2016 |
|
sl@0
|
2017 |
# cleanup
|
sl@0
|
2018 |
catch {file delete -force C:/globTest}
|
sl@0
|
2019 |
cd [temporaryDirectory]
|
sl@0
|
2020 |
file delete -force globTest
|
sl@0
|
2021 |
cd $oldpwd
|
sl@0
|
2022 |
set env(HOME) $oldhome
|
sl@0
|
2023 |
if {[tcltest::testConstraint testsetplatform]} {
|
sl@0
|
2024 |
testsetplatform $platform
|
sl@0
|
2025 |
catch {unset platform}
|
sl@0
|
2026 |
}
|
sl@0
|
2027 |
catch {unset oldhome temp result globPreResult}
|
sl@0
|
2028 |
::tcltest::cleanupTests
|
sl@0
|
2029 |
return
|