Fossil SCM

Add and refine tests, part 2.

mistachkin 2015-05-27 19:17 UTC mvRmHardFix
Commit 0b5b87ac84c8701cab65b87dfec7c743bbc812cd
1 file changed +222 -36
+222 -36
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -44,11 +44,21 @@
4444
write_file f5 "f5"
4545
write_file f6 "f6"
4646
write_file f7 "f7"
4747
write_file f8 "f8"
4848
49
-fossil add f1 f2 f3 f4 f5 f6 f7 f8
49
+file mkdir [file join $rootDir subdirA]
50
+# NOTE: There are no files in subdirA.
51
+
52
+file mkdir [file join $rootDir subdirB]
53
+write_file [file join $rootDir subdirB f9] "f9"
54
+
55
+file mkdir [file join $rootDir subdirC]
56
+write_file [file join $rootDir subdirC f10] "f10"
57
+write_file [file join $rootDir subdirC f11] "f11"
58
+
59
+fossil add f1 f2 f3 f4 f5 f6 f7 f8 subdirB/f9 subdirC/f10 subdirC/f11
5060
fossil commit -m "c1"
5161
5262
########################################
5363
# Test 1: Soft Move Relative Directory #
5464
########################################
@@ -59,30 +69,28 @@
5969
fossil mv ../f1 .
6070
test mv-soft-relative-1 {$RESULT eq "RENAME f1 subdir1/f1"}
6171
6272
fossil revert
6373
test mv-soft-relative-2 {
64
- [normalize_result] eq \
65
- "DELETE: subdir1/f1\nREVERTED: f1${undoMsg}"
74
+ [normalize_result] eq "DELETE: subdir1/f1\nREVERTED: f1${undoMsg}"
6675
}
6776
6877
cd $rootDir
6978
70
-########################################
71
-# Test 2: Soft Move Relative File #
72
-########################################
79
+###################################
80
+# Test 2: Soft Move Relative File #
81
+###################################
7382
7483
file mkdir [file join $rootDir subdir2]
7584
cd [file join $rootDir subdir2]
7685
7786
fossil mv ../f2 ./f2
7887
test mv-soft-relative-3 {$RESULT eq "RENAME f2 subdir2/f2"}
7988
8089
fossil revert
8190
test mv-soft-relative-4 {
82
- [normalize_result] eq \
83
- "DELETE: subdir2/f2\nREVERTED: f2${undoMsg}"
91
+ [normalize_result] eq "DELETE: subdir2/f2\nREVERTED: f2${undoMsg}"
8492
}
8593
8694
cd $rootDir
8795
8896
########################################
@@ -92,39 +100,35 @@
92100
file mkdir [file join $rootDir subdir3]
93101
cd [file join $rootDir subdir3]
94102
95103
fossil mv --hard ../f3 .
96104
test mv-hard-relative-1 {
97
- [normalize_result] eq \
98
- "RENAME f3 subdir3/f3\nMOVED_FILE ${rootDir}/f3"
105
+ [normalize_result] eq "RENAME f3 subdir3/f3\nMOVED_FILE ${rootDir}/f3"
99106
}
100107
101108
fossil revert
102109
test mv-hard-relative-2 {
103
- [normalize_result] eq \
104
- "DELETE: subdir3/f3\nREVERTED: f3${undoMsg}"
110
+ [normalize_result] eq "DELETE: subdir3/f3\nREVERTED: f3${undoMsg}"
105111
}
106112
107113
cd $rootDir
108114
109
-########################################
110
-# Test 4: Hard Move Relative File #
111
-########################################
115
+###################################
116
+# Test 4: Hard Move Relative File #
117
+###################################
112118
113119
file mkdir [file join $rootDir subdir4]
114120
cd [file join $rootDir subdir4]
115121
116122
fossil mv --hard ../f4 ./f4
117123
test mv-hard-relative-3 {
118
- [normalize_result] eq \
119
- "RENAME f4 subdir4/f4\nMOVED_FILE ${rootDir}/f4"
124
+ [normalize_result] eq "RENAME f4 subdir4/f4\nMOVED_FILE ${rootDir}/f4"
120125
}
121126
122127
fossil revert
123128
test mv-hard-relative-4 {
124
- [normalize_result] eq \
125
- "DELETE: subdir4/f4\nREVERTED: f4${undoMsg}"
129
+ [normalize_result] eq "DELETE: subdir4/f4\nREVERTED: f4${undoMsg}"
126130
}
127131
128132
cd $rootDir
129133
130134
########################################
@@ -137,30 +141,28 @@
137141
fossil mv [file join $rootDir f5] [file join $rootDir subdir5]
138142
test mv-soft-absolute-1 {$RESULT eq "RENAME f5 subdir5/f5"}
139143
140144
fossil revert
141145
test mv-soft-absolute-2 {
142
- [normalize_result] eq \
143
- "DELETE: subdir5/f5\nREVERTED: f5${undoMsg}"
146
+ [normalize_result] eq "DELETE: subdir5/f5\nREVERTED: f5${undoMsg}"
144147
}
145148
146149
cd $rootDir
147150
148
-########################################
149
-# Test 6: Soft Move Absolute File #
150
-########################################
151
+###################################
152
+# Test 6: Soft Move Absolute File #
153
+###################################
151154
152155
file mkdir [file join $rootDir subdir6]
153156
cd [file join $rootDir subdir6]
154157
155158
fossil mv [file join $rootDir f6] [file join $rootDir subdir6 f6]
156159
test mv-soft-absolute-3 {$RESULT eq "RENAME f6 subdir6/f6"}
157160
158161
fossil revert
159162
test mv-soft-absolute-4 {
160
- [normalize_result] eq \
161
- "DELETE: subdir6/f6\nREVERTED: f6${undoMsg}"
163
+ [normalize_result] eq "DELETE: subdir6/f6\nREVERTED: f6${undoMsg}"
162164
}
163165
164166
cd $rootDir
165167
166168
########################################
@@ -170,37 +172,221 @@
170172
file mkdir [file join $rootDir subdir7]
171173
cd [file join $rootDir subdir7]
172174
173175
fossil mv --hard [file join $rootDir f7] [file join $rootDir subdir7]
174176
test mv-hard-absolute-1 {
175
- [normalize_result] eq \
176
- "RENAME f7 subdir7/f7\nMOVED_FILE ${rootDir}/f7"
177
+ [normalize_result] eq "RENAME f7 subdir7/f7\nMOVED_FILE ${rootDir}/f7"
177178
}
178179
179180
fossil revert
180181
test mv-hard-absolute-2 {
181
- [normalize_result] eq \
182
- "DELETE: subdir7/f7\nREVERTED: f7${undoMsg}"
182
+ [normalize_result] eq "DELETE: subdir7/f7\nREVERTED: f7${undoMsg}"
183183
}
184184
185185
cd $rootDir
186186
187
-########################################
188
-# Test 8: Hard Move Absolute File #
189
-########################################
187
+###################################
188
+# Test 8: Hard Move Absolute File #
189
+###################################
190190
191191
file mkdir [file join $rootDir subdir8]
192192
cd [file join $rootDir subdir8]
193193
194194
fossil mv --hard [file join $rootDir f8] [file join $rootDir subdir8 f8]
195195
test mv-hard-absolute-3 {
196
- [normalize_result] eq \
197
- "RENAME f8 subdir8/f8\nMOVED_FILE ${rootDir}/f8"
196
+ [normalize_result] eq "RENAME f8 subdir8/f8\nMOVED_FILE ${rootDir}/f8"
198197
}
199198
200199
fossil revert
201200
test mv-hard-absolute-4 {
201
+ [normalize_result] eq "DELETE: subdir8/f8\nREVERTED: f8${undoMsg}"
202
+}
203
+
204
+cd $rootDir
205
+
206
+##########################################
207
+# Test 9: Soft Remove Relative Directory #
208
+##########################################
209
+
210
+file mkdir [file join $rootDir subdir1]
211
+cd [file join $rootDir subdir1]
212
+
213
+fossil rm ../subdirA
214
+test rm-soft-relative-1 {$RESULT eq ""}
215
+
216
+fossil rm ../subdirB
217
+test rm-soft-relative-2 {$RESULT eq "DELETED subdirB/f9"}
218
+
219
+fossil rm ../subdirC
220
+test rm-soft-relative-3 {
221
+ [normalize_result] eq "DELETED subdirC/f10\nDELETED subdirC/f11"
222
+}
223
+
224
+fossil revert
225
+test rm-soft-relative-4 {
226
+ [normalize_result] eq \
227
+ "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
228
+}
229
+
230
+cd $rootDir
231
+
232
+######################################
233
+# Test 10: Soft Remove Relative File #
234
+######################################
235
+
236
+file mkdir [file join $rootDir subdir2]
237
+cd [file join $rootDir subdir2]
238
+
239
+fossil rm ../f2
240
+test rm-soft-relative-5 {$RESULT eq "DELETED f2"}
241
+
242
+fossil revert
243
+test rm-soft-relative-6 {
244
+ [normalize_result] eq "REVERTED: f2${undoMsg}"
245
+}
246
+
247
+cd $rootDir
248
+
249
+###########################################
250
+# Test 11: Hard Remove Relative Directory #
251
+###########################################
252
+
253
+file mkdir [file join $rootDir subdir3]
254
+cd [file join $rootDir subdir3]
255
+
256
+fossil rm --hard ../subdirA
257
+test rm-hard-relative-1 {
258
+ [normalize_result] eq ""
259
+}
260
+
261
+fossil rm --hard ../subdirB
262
+test rm-hard-relative-2 {
263
+ [normalize_result] eq \
264
+ "DELETED subdirB/f9\nDELETED_FILE ${rootDir}/subdirB/f9"
265
+}
266
+
267
+fossil rm --hard ../subdirC
268
+test rm-hard-relative-3 {
269
+ [normalize_result] eq \
270
+ "DELETED subdirC/f10\nDELETED subdirC/f11\nDELETED_FILE\
271
+${rootDir}/subdirC/f10\nDELETED_FILE ${rootDir}/subdirC/f11"
272
+}
273
+
274
+fossil revert
275
+test rm-hard-relative-4 {
276
+ [normalize_result] eq \
277
+ "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
278
+}
279
+
280
+cd $rootDir
281
+
282
+######################################
283
+# Test 12: Hard Remove Relative File #
284
+######################################
285
+
286
+file mkdir [file join $rootDir subdir4]
287
+cd [file join $rootDir subdir4]
288
+
289
+fossil rm --hard ../f4
290
+test rm-hard-relative-5 {
291
+ [normalize_result] eq "DELETED f4\nDELETED_FILE ${rootDir}/f4"
292
+}
293
+
294
+fossil revert
295
+test rm-hard-relative-6 {
296
+ [normalize_result] eq "REVERTED: f4${undoMsg}"
297
+}
298
+
299
+cd $rootDir
300
+
301
+###########################################
302
+# Test 13: Soft Remove Absolute Directory #
303
+###########################################
304
+
305
+file mkdir [file join $rootDir subdir5]
306
+cd [file join $rootDir subdir5]
307
+
308
+fossil rm [file join $rootDir subdirA]
309
+test rm-soft-absolute-1 {$RESULT eq ""}
310
+
311
+fossil rm [file join $rootDir subdirB]
312
+test rm-soft-absolute-2 {$RESULT eq "DELETED subdirB/f9"}
313
+
314
+fossil rm [file join $rootDir subdirC]
315
+test rm-soft-absolute-3 {
316
+ [normalize_result] eq "DELETED subdirC/f10\nDELETED subdirC/f11"
317
+}
318
+
319
+fossil revert
320
+test rm-soft-absolute-4 {
321
+ [normalize_result] eq \
322
+ "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
323
+}
324
+
325
+cd $rootDir
326
+
327
+######################################
328
+# Test 14: Soft Remove Absolute File #
329
+######################################
330
+
331
+file mkdir [file join $rootDir subdir6]
332
+cd [file join $rootDir subdir6]
333
+
334
+fossil rm [file join $rootDir f6]
335
+test rm-soft-absolute-5 {$RESULT eq "DELETED f6"}
336
+
337
+fossil revert
338
+test rm-soft-absolute-6 {
339
+ [normalize_result] eq "REVERTED: f6${undoMsg}"
340
+}
341
+
342
+cd $rootDir
343
+
344
+###########################################
345
+# Test 15: Hard Remove Absolute Directory #
346
+###########################################
347
+
348
+file mkdir [file join $rootDir subdir7]
349
+cd [file join $rootDir subdir7]
350
+
351
+fossil rm --hard [file join $rootDir subdirA]
352
+test rm-hard-absolute-1 {$RESULT eq ""}
353
+
354
+fossil rm --hard [file join $rootDir subdirB]
355
+test rm-hard-absolute-2 {
356
+ [normalize_result] eq \
357
+ "DELETED subdirB/f9\nDELETED_FILE ${rootDir}/subdirB/f9"
358
+}
359
+
360
+fossil rm --hard [file join $rootDir subdirC]
361
+test rm-hard-absolute-3 {
362
+ [normalize_result] eq \
363
+ "DELETED subdirC/f10\nDELETED subdirC/f11\nDELETED_FILE\
364
+${rootDir}/subdirC/f10\nDELETED_FILE ${rootDir}/subdirC/f11"
365
+}
366
+
367
+fossil revert
368
+test rm-hard-absolute-4 {
202369
[normalize_result] eq \
203
- "DELETE: subdir8/f8\nREVERTED: f8${undoMsg}"
370
+ "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
371
+}
372
+
373
+cd $rootDir
374
+
375
+######################################
376
+# Test 16: Hard Remove Absolute File #
377
+######################################
378
+
379
+file mkdir [file join $rootDir subdir8]
380
+cd [file join $rootDir subdir8]
381
+
382
+fossil rm --hard [file join $rootDir f8]
383
+test rm-hard-absolute-5 {
384
+ [normalize_result] eq "DELETED f8\nDELETED_FILE ${rootDir}/f8"
385
+}
386
+
387
+fossil revert
388
+test rm-hard-absolute-6 {
389
+ [normalize_result] eq "REVERTED: f8${undoMsg}"
204390
}
205391
206392
cd $rootDir
207393
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -44,11 +44,21 @@
44 write_file f5 "f5"
45 write_file f6 "f6"
46 write_file f7 "f7"
47 write_file f8 "f8"
48
49 fossil add f1 f2 f3 f4 f5 f6 f7 f8
 
 
 
 
 
 
 
 
 
 
50 fossil commit -m "c1"
51
52 ########################################
53 # Test 1: Soft Move Relative Directory #
54 ########################################
@@ -59,30 +69,28 @@
59 fossil mv ../f1 .
60 test mv-soft-relative-1 {$RESULT eq "RENAME f1 subdir1/f1"}
61
62 fossil revert
63 test mv-soft-relative-2 {
64 [normalize_result] eq \
65 "DELETE: subdir1/f1\nREVERTED: f1${undoMsg}"
66 }
67
68 cd $rootDir
69
70 ########################################
71 # Test 2: Soft Move Relative File #
72 ########################################
73
74 file mkdir [file join $rootDir subdir2]
75 cd [file join $rootDir subdir2]
76
77 fossil mv ../f2 ./f2
78 test mv-soft-relative-3 {$RESULT eq "RENAME f2 subdir2/f2"}
79
80 fossil revert
81 test mv-soft-relative-4 {
82 [normalize_result] eq \
83 "DELETE: subdir2/f2\nREVERTED: f2${undoMsg}"
84 }
85
86 cd $rootDir
87
88 ########################################
@@ -92,39 +100,35 @@
92 file mkdir [file join $rootDir subdir3]
93 cd [file join $rootDir subdir3]
94
95 fossil mv --hard ../f3 .
96 test mv-hard-relative-1 {
97 [normalize_result] eq \
98 "RENAME f3 subdir3/f3\nMOVED_FILE ${rootDir}/f3"
99 }
100
101 fossil revert
102 test mv-hard-relative-2 {
103 [normalize_result] eq \
104 "DELETE: subdir3/f3\nREVERTED: f3${undoMsg}"
105 }
106
107 cd $rootDir
108
109 ########################################
110 # Test 4: Hard Move Relative File #
111 ########################################
112
113 file mkdir [file join $rootDir subdir4]
114 cd [file join $rootDir subdir4]
115
116 fossil mv --hard ../f4 ./f4
117 test mv-hard-relative-3 {
118 [normalize_result] eq \
119 "RENAME f4 subdir4/f4\nMOVED_FILE ${rootDir}/f4"
120 }
121
122 fossil revert
123 test mv-hard-relative-4 {
124 [normalize_result] eq \
125 "DELETE: subdir4/f4\nREVERTED: f4${undoMsg}"
126 }
127
128 cd $rootDir
129
130 ########################################
@@ -137,30 +141,28 @@
137 fossil mv [file join $rootDir f5] [file join $rootDir subdir5]
138 test mv-soft-absolute-1 {$RESULT eq "RENAME f5 subdir5/f5"}
139
140 fossil revert
141 test mv-soft-absolute-2 {
142 [normalize_result] eq \
143 "DELETE: subdir5/f5\nREVERTED: f5${undoMsg}"
144 }
145
146 cd $rootDir
147
148 ########################################
149 # Test 6: Soft Move Absolute File #
150 ########################################
151
152 file mkdir [file join $rootDir subdir6]
153 cd [file join $rootDir subdir6]
154
155 fossil mv [file join $rootDir f6] [file join $rootDir subdir6 f6]
156 test mv-soft-absolute-3 {$RESULT eq "RENAME f6 subdir6/f6"}
157
158 fossil revert
159 test mv-soft-absolute-4 {
160 [normalize_result] eq \
161 "DELETE: subdir6/f6\nREVERTED: f6${undoMsg}"
162 }
163
164 cd $rootDir
165
166 ########################################
@@ -170,37 +172,221 @@
170 file mkdir [file join $rootDir subdir7]
171 cd [file join $rootDir subdir7]
172
173 fossil mv --hard [file join $rootDir f7] [file join $rootDir subdir7]
174 test mv-hard-absolute-1 {
175 [normalize_result] eq \
176 "RENAME f7 subdir7/f7\nMOVED_FILE ${rootDir}/f7"
177 }
178
179 fossil revert
180 test mv-hard-absolute-2 {
181 [normalize_result] eq \
182 "DELETE: subdir7/f7\nREVERTED: f7${undoMsg}"
183 }
184
185 cd $rootDir
186
187 ########################################
188 # Test 8: Hard Move Absolute File #
189 ########################################
190
191 file mkdir [file join $rootDir subdir8]
192 cd [file join $rootDir subdir8]
193
194 fossil mv --hard [file join $rootDir f8] [file join $rootDir subdir8 f8]
195 test mv-hard-absolute-3 {
196 [normalize_result] eq \
197 "RENAME f8 subdir8/f8\nMOVED_FILE ${rootDir}/f8"
198 }
199
200 fossil revert
201 test mv-hard-absolute-4 {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202 [normalize_result] eq \
203 "DELETE: subdir8/f8\nREVERTED: f8${undoMsg}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204 }
205
206 cd $rootDir
207
--- test/mv-rm.test
+++ test/mv-rm.test
@@ -44,11 +44,21 @@
44 write_file f5 "f5"
45 write_file f6 "f6"
46 write_file f7 "f7"
47 write_file f8 "f8"
48
49 file mkdir [file join $rootDir subdirA]
50 # NOTE: There are no files in subdirA.
51
52 file mkdir [file join $rootDir subdirB]
53 write_file [file join $rootDir subdirB f9] "f9"
54
55 file mkdir [file join $rootDir subdirC]
56 write_file [file join $rootDir subdirC f10] "f10"
57 write_file [file join $rootDir subdirC f11] "f11"
58
59 fossil add f1 f2 f3 f4 f5 f6 f7 f8 subdirB/f9 subdirC/f10 subdirC/f11
60 fossil commit -m "c1"
61
62 ########################################
63 # Test 1: Soft Move Relative Directory #
64 ########################################
@@ -59,30 +69,28 @@
69 fossil mv ../f1 .
70 test mv-soft-relative-1 {$RESULT eq "RENAME f1 subdir1/f1"}
71
72 fossil revert
73 test mv-soft-relative-2 {
74 [normalize_result] eq "DELETE: subdir1/f1\nREVERTED: f1${undoMsg}"
 
75 }
76
77 cd $rootDir
78
79 ###################################
80 # Test 2: Soft Move Relative File #
81 ###################################
82
83 file mkdir [file join $rootDir subdir2]
84 cd [file join $rootDir subdir2]
85
86 fossil mv ../f2 ./f2
87 test mv-soft-relative-3 {$RESULT eq "RENAME f2 subdir2/f2"}
88
89 fossil revert
90 test mv-soft-relative-4 {
91 [normalize_result] eq "DELETE: subdir2/f2\nREVERTED: f2${undoMsg}"
 
92 }
93
94 cd $rootDir
95
96 ########################################
@@ -92,39 +100,35 @@
100 file mkdir [file join $rootDir subdir3]
101 cd [file join $rootDir subdir3]
102
103 fossil mv --hard ../f3 .
104 test mv-hard-relative-1 {
105 [normalize_result] eq "RENAME f3 subdir3/f3\nMOVED_FILE ${rootDir}/f3"
 
106 }
107
108 fossil revert
109 test mv-hard-relative-2 {
110 [normalize_result] eq "DELETE: subdir3/f3\nREVERTED: f3${undoMsg}"
 
111 }
112
113 cd $rootDir
114
115 ###################################
116 # Test 4: Hard Move Relative File #
117 ###################################
118
119 file mkdir [file join $rootDir subdir4]
120 cd [file join $rootDir subdir4]
121
122 fossil mv --hard ../f4 ./f4
123 test mv-hard-relative-3 {
124 [normalize_result] eq "RENAME f4 subdir4/f4\nMOVED_FILE ${rootDir}/f4"
 
125 }
126
127 fossil revert
128 test mv-hard-relative-4 {
129 [normalize_result] eq "DELETE: subdir4/f4\nREVERTED: f4${undoMsg}"
 
130 }
131
132 cd $rootDir
133
134 ########################################
@@ -137,30 +141,28 @@
141 fossil mv [file join $rootDir f5] [file join $rootDir subdir5]
142 test mv-soft-absolute-1 {$RESULT eq "RENAME f5 subdir5/f5"}
143
144 fossil revert
145 test mv-soft-absolute-2 {
146 [normalize_result] eq "DELETE: subdir5/f5\nREVERTED: f5${undoMsg}"
 
147 }
148
149 cd $rootDir
150
151 ###################################
152 # Test 6: Soft Move Absolute File #
153 ###################################
154
155 file mkdir [file join $rootDir subdir6]
156 cd [file join $rootDir subdir6]
157
158 fossil mv [file join $rootDir f6] [file join $rootDir subdir6 f6]
159 test mv-soft-absolute-3 {$RESULT eq "RENAME f6 subdir6/f6"}
160
161 fossil revert
162 test mv-soft-absolute-4 {
163 [normalize_result] eq "DELETE: subdir6/f6\nREVERTED: f6${undoMsg}"
 
164 }
165
166 cd $rootDir
167
168 ########################################
@@ -170,37 +172,221 @@
172 file mkdir [file join $rootDir subdir7]
173 cd [file join $rootDir subdir7]
174
175 fossil mv --hard [file join $rootDir f7] [file join $rootDir subdir7]
176 test mv-hard-absolute-1 {
177 [normalize_result] eq "RENAME f7 subdir7/f7\nMOVED_FILE ${rootDir}/f7"
 
178 }
179
180 fossil revert
181 test mv-hard-absolute-2 {
182 [normalize_result] eq "DELETE: subdir7/f7\nREVERTED: f7${undoMsg}"
 
183 }
184
185 cd $rootDir
186
187 ###################################
188 # Test 8: Hard Move Absolute File #
189 ###################################
190
191 file mkdir [file join $rootDir subdir8]
192 cd [file join $rootDir subdir8]
193
194 fossil mv --hard [file join $rootDir f8] [file join $rootDir subdir8 f8]
195 test mv-hard-absolute-3 {
196 [normalize_result] eq "RENAME f8 subdir8/f8\nMOVED_FILE ${rootDir}/f8"
 
197 }
198
199 fossil revert
200 test mv-hard-absolute-4 {
201 [normalize_result] eq "DELETE: subdir8/f8\nREVERTED: f8${undoMsg}"
202 }
203
204 cd $rootDir
205
206 ##########################################
207 # Test 9: Soft Remove Relative Directory #
208 ##########################################
209
210 file mkdir [file join $rootDir subdir1]
211 cd [file join $rootDir subdir1]
212
213 fossil rm ../subdirA
214 test rm-soft-relative-1 {$RESULT eq ""}
215
216 fossil rm ../subdirB
217 test rm-soft-relative-2 {$RESULT eq "DELETED subdirB/f9"}
218
219 fossil rm ../subdirC
220 test rm-soft-relative-3 {
221 [normalize_result] eq "DELETED subdirC/f10\nDELETED subdirC/f11"
222 }
223
224 fossil revert
225 test rm-soft-relative-4 {
226 [normalize_result] eq \
227 "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
228 }
229
230 cd $rootDir
231
232 ######################################
233 # Test 10: Soft Remove Relative File #
234 ######################################
235
236 file mkdir [file join $rootDir subdir2]
237 cd [file join $rootDir subdir2]
238
239 fossil rm ../f2
240 test rm-soft-relative-5 {$RESULT eq "DELETED f2"}
241
242 fossil revert
243 test rm-soft-relative-6 {
244 [normalize_result] eq "REVERTED: f2${undoMsg}"
245 }
246
247 cd $rootDir
248
249 ###########################################
250 # Test 11: Hard Remove Relative Directory #
251 ###########################################
252
253 file mkdir [file join $rootDir subdir3]
254 cd [file join $rootDir subdir3]
255
256 fossil rm --hard ../subdirA
257 test rm-hard-relative-1 {
258 [normalize_result] eq ""
259 }
260
261 fossil rm --hard ../subdirB
262 test rm-hard-relative-2 {
263 [normalize_result] eq \
264 "DELETED subdirB/f9\nDELETED_FILE ${rootDir}/subdirB/f9"
265 }
266
267 fossil rm --hard ../subdirC
268 test rm-hard-relative-3 {
269 [normalize_result] eq \
270 "DELETED subdirC/f10\nDELETED subdirC/f11\nDELETED_FILE\
271 ${rootDir}/subdirC/f10\nDELETED_FILE ${rootDir}/subdirC/f11"
272 }
273
274 fossil revert
275 test rm-hard-relative-4 {
276 [normalize_result] eq \
277 "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
278 }
279
280 cd $rootDir
281
282 ######################################
283 # Test 12: Hard Remove Relative File #
284 ######################################
285
286 file mkdir [file join $rootDir subdir4]
287 cd [file join $rootDir subdir4]
288
289 fossil rm --hard ../f4
290 test rm-hard-relative-5 {
291 [normalize_result] eq "DELETED f4\nDELETED_FILE ${rootDir}/f4"
292 }
293
294 fossil revert
295 test rm-hard-relative-6 {
296 [normalize_result] eq "REVERTED: f4${undoMsg}"
297 }
298
299 cd $rootDir
300
301 ###########################################
302 # Test 13: Soft Remove Absolute Directory #
303 ###########################################
304
305 file mkdir [file join $rootDir subdir5]
306 cd [file join $rootDir subdir5]
307
308 fossil rm [file join $rootDir subdirA]
309 test rm-soft-absolute-1 {$RESULT eq ""}
310
311 fossil rm [file join $rootDir subdirB]
312 test rm-soft-absolute-2 {$RESULT eq "DELETED subdirB/f9"}
313
314 fossil rm [file join $rootDir subdirC]
315 test rm-soft-absolute-3 {
316 [normalize_result] eq "DELETED subdirC/f10\nDELETED subdirC/f11"
317 }
318
319 fossil revert
320 test rm-soft-absolute-4 {
321 [normalize_result] eq \
322 "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
323 }
324
325 cd $rootDir
326
327 ######################################
328 # Test 14: Soft Remove Absolute File #
329 ######################################
330
331 file mkdir [file join $rootDir subdir6]
332 cd [file join $rootDir subdir6]
333
334 fossil rm [file join $rootDir f6]
335 test rm-soft-absolute-5 {$RESULT eq "DELETED f6"}
336
337 fossil revert
338 test rm-soft-absolute-6 {
339 [normalize_result] eq "REVERTED: f6${undoMsg}"
340 }
341
342 cd $rootDir
343
344 ###########################################
345 # Test 15: Hard Remove Absolute Directory #
346 ###########################################
347
348 file mkdir [file join $rootDir subdir7]
349 cd [file join $rootDir subdir7]
350
351 fossil rm --hard [file join $rootDir subdirA]
352 test rm-hard-absolute-1 {$RESULT eq ""}
353
354 fossil rm --hard [file join $rootDir subdirB]
355 test rm-hard-absolute-2 {
356 [normalize_result] eq \
357 "DELETED subdirB/f9\nDELETED_FILE ${rootDir}/subdirB/f9"
358 }
359
360 fossil rm --hard [file join $rootDir subdirC]
361 test rm-hard-absolute-3 {
362 [normalize_result] eq \
363 "DELETED subdirC/f10\nDELETED subdirC/f11\nDELETED_FILE\
364 ${rootDir}/subdirC/f10\nDELETED_FILE ${rootDir}/subdirC/f11"
365 }
366
367 fossil revert
368 test rm-hard-absolute-4 {
369 [normalize_result] eq \
370 "REVERTED: subdirB/f9\nREVERTED: subdirC/f10\nREVERTED: subdirC/f11${undoMsg}"
371 }
372
373 cd $rootDir
374
375 ######################################
376 # Test 16: Hard Remove Absolute File #
377 ######################################
378
379 file mkdir [file join $rootDir subdir8]
380 cd [file join $rootDir subdir8]
381
382 fossil rm --hard [file join $rootDir f8]
383 test rm-hard-absolute-5 {
384 [normalize_result] eq "DELETED f8\nDELETED_FILE ${rootDir}/f8"
385 }
386
387 fossil revert
388 test rm-hard-absolute-6 {
389 [normalize_result] eq "REVERTED: f8${undoMsg}"
390 }
391
392 cd $rootDir
393

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button