Diff
Not logged in

Differences From Artifact [29f7083217]:

To Artifact [e8159b146a]:


27
28
29
30
31
32
33















34
35
36
37
38
39
40
	file delete -force [file join dir.dir linkinside.file]
    }

makeFile "test file" gorp.file
makeDirectory dir.dir
makeDirectory [file join dir.dir dirinside.dir]
makeFile "test file in directory" [file join dir.dir inside.file]
















proc testPathEqual {one two} {
    if {[string equal $one $two]} {
	return 1
    } else {
	return "not equal: $one $two"
    }







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	file delete -force [file join dir.dir linkinside.file]
    }

makeFile "test file" gorp.file
makeDirectory dir.dir
makeDirectory [file join dir.dir dirinside.dir]
makeFile "test file in directory" [file join dir.dir inside.file]

tcltest::testConstraint unusedDrive 0
set drive {}
if {$::tcl_platform(platform) eq "windows"} {
    set vols [string map [list :/ {}] [file volumes]]
    for {set i 0} {$i < 26} {incr i} {
	set drive [format %c [expr {$i + 65}]]
	if {[lsearch -exact $vols $drive] == -1} {
	    tcltest::testConstraint unusedDrive 1
	    break
	}
    }
    unset i vols
    # The variable 'drive' will be used below
}

proc testPathEqual {one two} {
    if {[string equal $one $two]} {
	return 1
    } else {
	return "not equal: $one $two"
    }
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
    file normalize c:\\..
} {C:/}

test filesystem-1.18 {file normalisation} {winOnly} {
    file normalize c:/./
} {C:/}

test filesystem-1.19 {file normalisation} {winOnly} {
    file normalize w:/./../../..
} {w:/}

test filesystem-1.20 {file normalisation} {winOnly} {
    file normalize //name/foo/../
} {//name/foo}

test filesystem-1.21 {file normalisation} {winOnly} {
    file normalize C:///foo/./
} {C:/foo}

test filesystem-1.22 {file normalisation} {winOnly} {
    file normalize //name/foo/.
} {//name/foo}

test filesystem-1.23 {file normalisation} {winOnly} {
    file normalize c:/./foo
} {C:/foo}

test filesystem-1.24 {file normalisation} {winOnly} {
    file normalize w:/./../../../a
} {w:/a}

test filesystem-1.25 {file normalisation} {winOnly} {
    file normalize w:/./.././../../a
} {w:/a}

test filesystem-1.25.1 {file normalisation} {winOnly} {
    file normalize w:/./.././..\\..\\a\\bb
} {w:/a/bb}

test filesystem-1.26 {link normalisation: link and ..} {hasLinks} {
    file delete -force dir2.link
    set dir [file join dir2 foo bar]
    file mkdir $dir
    file link dir2.link [file join dir2 foo bar]
    set res [list [file normalize [file join dir2 foo x]] \







|
|
|

















|
|
|

|
|
|

|
|
|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
    file normalize c:\\..
} {C:/}

test filesystem-1.18 {file normalisation} {winOnly} {
    file normalize c:/./
} {C:/}

test filesystem-1.19 {file normalisation} {winOnly unusedDrive} {
    file normalize ${drive}:/./../../..
} "${drive}:/"

test filesystem-1.20 {file normalisation} {winOnly} {
    file normalize //name/foo/../
} {//name/foo}

test filesystem-1.21 {file normalisation} {winOnly} {
    file normalize C:///foo/./
} {C:/foo}

test filesystem-1.22 {file normalisation} {winOnly} {
    file normalize //name/foo/.
} {//name/foo}

test filesystem-1.23 {file normalisation} {winOnly} {
    file normalize c:/./foo
} {C:/foo}

test filesystem-1.24 {file normalisation} {winOnly unusedDrive} {
    file normalize ${drive}:/./../../../a
} "${drive}:/a"

test filesystem-1.25 {file normalisation} {winOnly unusedDrive} {
    file normalize ${drive}:/./.././../../a
} "${drive}:/a"

test filesystem-1.25.1 {file normalisation} {winOnly unusedDrive} {
    file normalize ${drive}:/./.././..\\..\\a\\bb
} "${drive}:/a/bb"

test filesystem-1.26 {link normalisation: link and ..} {hasLinks} {
    file delete -force dir2.link
    set dir [file join dir2 foo bar]
    file mkdir $dir
    file link dir2.link [file join dir2 foo bar]
    set res [list [file normalize [file join dir2 foo x]] \
809
810
811
812
813
814
815

816
817
818

    set yyy [file split $anchor]
    set dst [file join  $anchor $dst]
    lappend res $dst $yyy
} {foo foo {}}

cleanupTests

}
namespace delete ::tcl::test::fileSystem
return







>



824
825
826
827
828
829
830
831
832
833
834

    set yyy [file split $anchor]
    set dst [file join  $anchor $dst]
    lappend res $dst $yyy
} {foo foo {}}

cleanupTests
unset -nocomplain drive
}
namespace delete ::tcl::test::fileSystem
return