blob: 95dbd0c0c823384420e2f6441d94f19c4ee45c2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
56
57
58
59
60
61
62
63
64
65
66
67
|
source testing.tcl
package-or-skip file
package-or-skip exec
catch {
exec rm -rf tmp
exec mkdir tmp
exec touch tmp/file
exec mkdir tmp/dir
}
test mkdir-1.1 "Simple dir" {
file mkdir tmp/abc
file isdir tmp/abc
} {1}
test mkdir-1.2 "Create missing parents" {
file mkdir tmp/def/ghi/jkl
file isdir tmp/def/ghi/jkl
} {1}
test mkdir-1.3 "Existing dir" {
file mkdir tmp/dir
file isdir tmp/dir
} {1}
test mkdir-1.4 "Child of existing dir" {
file mkdir tmp/dir/child
file isdir tmp/dir/child
} {1}
test mkdir-1.5 "Create dir over existing file" {
list [catch {file mkdir tmp/file} msg] [file isdir tmp/file]
} {1 0}
test mkdir-1.6 "Create dir below existing file" {
list [catch {file mkdir tmp/file/dir} msg] [file isdir tmp/file/dir]
} {1 0}
test mkdir-1.8 "Multiple dirs" {
file mkdir tmp/1 tmp/2 tmp/3
list [file isdir tmp/1] [file isdir tmp/2] [file isdir tmp/3]
} {1 1 1}
test mkdir-1.7 "Stop on failure" {
catch {file mkdir tmp/4 tmp/file tmp/5}
list [file isdir tmp/4] [file isdir tmp/5]
} {1 0}
test rmdir-2.0 "Remove existing dir" {
file delete tmp/1
file isdir tmp/1
} {0}
test rmdir-2.1 "Remove missing dir" {
file delete tmp/1
} {}
test rmdir-2.2 "Remove non-empty dir" {
catch {file delete tmp/def}
} {1}
catch {
exec rm -rf tmp
}
testreport
|