Fossil SCM

Updates to the 'amend' tests.

mistachkin 2020-06-11 02:06 trunk
Commit 47f19d8eb0099cc1bc526e5e21e08bfe7bb9927d2f11379ed4c559eeb8d4f44e
1 file changed +12 -15
+12 -15
--- test/amend.test
+++ test/amend.test
@@ -103,11 +103,11 @@
103103
1234 1234
104104
123456 #123456
105105
} {
106106
incr tc
107107
fossil amend $HASH -bgcolor $color
108
- test amend-bgcolor-1.$tc.a {[string match "*uuid:*$HASH*" $RESULT]}
108
+ test amend-bgcolor-1.$tc.a {[string match "*hash:*$HASH*" $RESULT]}
109109
fossil tag list --raw $HASH
110110
test amend-bgcolor-1.$tc.b {[string first "bgcolor=$result" $RESULT] != -1}
111111
fossil timeline -n 1
112112
test amend-bgcolor-1.$tc.c {
113113
[string match "*Change*background*color*to*\"$result\"*" $RESULT]
@@ -121,11 +121,11 @@
121121
if {$VERBOSE} { protOut "No artifact found in timeline output" }
122122
test amend-bgcolor-1.$tc.d false
123123
}
124124
}
125125
fossil amend $HASH -bgcolor {}
126
-test amend-bgcolor-2.1 {[string match "*uuid:*$HASH*" $RESULT]}
126
+test amend-bgcolor-2.1 {[string match "*hash:*$HASH*" $RESULT]}
127127
fossil tag list --raw $HASH
128128
test amend-bgcolor-2.2 {
129129
[string first "bgcolor=" $RESULT] == -1 &&
130130
[string first "bgcolor" $RESULT] != -1
131131
}
@@ -147,11 +147,11 @@
147147
if {![uuid_from_branch $RESULT HASH2]} {
148148
test amend-branchcolor.setup false
149149
}
150150
fossil update $HASH2
151151
fossil amend $HASH2 -branchcolor yellow
152
-test amend-branchcolor-1.1 {[string match "*uuid:*$HASH2*" $RESULT]}
152
+test amend-branchcolor-1.1 {[string match "*hash:*$HASH2*" $RESULT]}
153153
fossil tag ls --raw $HASH2
154154
test amend-branchcolor-1.2 {[string first "bgcolor=yellow" $RESULT] != -1}
155155
fossil timeline -n 1
156156
test amend-branchcolor-1.3 {
157157
[string match {*Change*branch*background*color*to*"yellow".*} $RESULT]
@@ -175,11 +175,11 @@
175175
write_file datafile "bc1"
176176
fossil commit -m "mc1"
177177
write_file datafile "bc2"
178178
fossil commit -m "mc2"
179179
fossil amend $HASHN -branchcolor deadbe
180
-test amend-branchcolor-2.1 {[string match "*uuid:*$HASHN*" $RESULT]}
180
+test amend-branchcolor-2.1 {[string match "*hash:*$HASHN*" $RESULT]}
181181
fossil tag ls --raw current
182182
test amend-branchcolor-2.2 {[string first "bgcolor=#deadbe" $RESULT] != -1}
183183
fossil timeline -n 1
184184
test amend-branchcolor-2.3 {
185185
[string match {*Change*branch*background*color*to*"#deadbe".*} $RESULT]
@@ -201,11 +201,11 @@
201201
set timestamp [clock scan yesterday]
202202
set date [clock format $timestamp -format "%Y-%m-%d" -gmt 1]
203203
set time [clock format $timestamp -format "%H:%M:%S" -gmt 1]
204204
set datetime "$date $time"
205205
fossil amend $HASHINIT -date $datetime
206
-test amend-date-1.1 {[string match "*uuid:*$HASHINIT*$datetime*" $RESULT]}
206
+test amend-date-1.1 {[string match "*hash:*$HASHINIT*$datetime*" $RESULT]}
207207
fossil tag ls --raw $HASHINIT
208208
test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1}
209209
fossil timeline -n 1
210210
test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]}
211211
set badformats {
@@ -232,11 +232,11 @@
232232
fossil branch new tohide current
233233
if {![uuid_from_branch $RESULT HASHH]} {
234234
test amend-hide-setup false
235235
}
236236
fossil amend $HASHH -hide
237
-test amend-hide-1.1 {[string match "*uuid:*$HASHH*" $RESULT]}
237
+test amend-hide-1.1 {[string match "*hash:*$HASHH*" $RESULT]}
238238
fossil tag ls --raw $HASHH
239239
test amend-hide-1.2 {[string first "hidden" $RESULT] != -1}
240240
fossil timeline -n 1
241241
test amend-hide-1.3 {[string match {*Add*propagating*"hidden".*} $RESULT]}
242242
@@ -248,11 +248,11 @@
248248
if {![uuid_from_branch $RESULT HASHC]} {
249249
test amend-close.setup false
250250
}
251251
fossil update $HASHC
252252
fossil amend $HASHC -close
253
-test amend-close-1.1.a {[string match "*uuid:*$HASHC*" $RESULT]}
253
+test amend-close-1.1.a {[string match "*hash:*$HASHC*" $RESULT]}
254254
test amend-close-1.1.b {
255255
[string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
256256
}
257257
fossil tag ls --raw $HASHC
258258
test amend-close-1.2 {[string first "closed" $RESULT] != -1}
@@ -273,11 +273,11 @@
273273
write_file datafile "b1"
274274
fossil commit -m "m1"
275275
write_file datafile "b2"
276276
fossil commit -m "m2"
277277
fossil amend $HASH3 --close
278
-test amend-close-3.1 {[string match "*uuid:*$HASH3*" $RESULT]}
278
+test amend-close-3.1 {[string match "*hash:*$HASH3*" $RESULT]}
279279
fossil tag ls --raw current
280280
test amend-close-3.2 {[string first "closed" $RESULT] != -1}
281281
fossil timeline -n 1
282282
test amend-close-3.3 {
283283
[string match "*Add*propagating*\"closed\".*" $RESULT]
@@ -311,11 +311,11 @@
311311
append t2exp "sym-$res*"
312312
append t3exp "Add*tag*\"$res\".*"
313313
append t5exp "Cancel*tag*\"$res\".*"
314314
}
315315
eval fossil amend $HASH $tags
316
- test amend-tag-$tc.1 {[string match "*uuid:*$HASH*tags:*$t1exp*" $RESULT]}
316
+ test amend-tag-$tc.1 {[string match "*hash:*$HASH*tags:*$t1exp*" $RESULT]}
317317
fossil tag ls --raw $HASH
318318
test amend-tag-$tc.2 {[string match $t2exp $RESULT]}
319319
fossil timeline -n 1
320320
test amend-tag-$tc.3 {[string match $t3exp $RESULT]}
321321
eval fossil amend $HASH $cancels
@@ -341,11 +341,11 @@
341341
342342
proc test-comment {name HASH comment} {
343343
global VERBOSE RESULT
344344
345345
test amend-comment-$name.1 {
346
- [string match "*uuid:*$HASH*comment:*$comment*" $RESULT]
346
+ [string match "*hash:*$HASH*comment:*$comment*" $RESULT]
347347
}
348348
fossil timeline -n 1
349349
if {[artifact_from_timeline $RESULT artid]} {
350350
fossil artifact $artid
351351
test amend-comment-$name.2 {
@@ -359,11 +359,11 @@
359359
test amend-comment-$name.3 {
360360
[string match "*[short_uuid $HASH]*Edit*check-in*comment.*" $RESULT]
361361
}
362362
fossil info $HASH
363363
test amend-comment-$name.4 {
364
- [string match "*uuid:*$HASH*comment:*$comment*" $RESULT]
364
+ [string match "*hash:*$HASH*comment:*$comment*" $RESULT]
365365
}
366366
}
367367
368368
prep-test "revision 1" "revision 1"
369369
fossil amend $HASH -comment "revised revision 1"
@@ -382,14 +382,11 @@
382382
write_file commitmsg "revision 4 revised with -M"
383383
fossil amend $HASH -M commitmsg
384384
test-comment 4 $HASH "revision 4 revised with -M"
385385
386386
prep-test "final comment" "final content"
387
-if {[catch {exec which ed} result]} {
388
- if {$VERBOSE} { protOut "Install ed for interactive comment test: $result" }
389
- test-comment 5 $HASH "ed required for interactive edit"
390
-} else {
387
+if {[catch {exec which ed} result] == 0} {
391388
fossil settings editor "ed -s"
392389
set comment "interactive edited comment"
393390
fossil_maybe_answer "a\n$comment\n.\nw\nq\n" amend $HASH --edit-comment
394391
test-comment 5 $HASH $comment
395392
}
396393
--- test/amend.test
+++ test/amend.test
@@ -103,11 +103,11 @@
103 1234 1234
104 123456 #123456
105 } {
106 incr tc
107 fossil amend $HASH -bgcolor $color
108 test amend-bgcolor-1.$tc.a {[string match "*uuid:*$HASH*" $RESULT]}
109 fossil tag list --raw $HASH
110 test amend-bgcolor-1.$tc.b {[string first "bgcolor=$result" $RESULT] != -1}
111 fossil timeline -n 1
112 test amend-bgcolor-1.$tc.c {
113 [string match "*Change*background*color*to*\"$result\"*" $RESULT]
@@ -121,11 +121,11 @@
121 if {$VERBOSE} { protOut "No artifact found in timeline output" }
122 test amend-bgcolor-1.$tc.d false
123 }
124 }
125 fossil amend $HASH -bgcolor {}
126 test amend-bgcolor-2.1 {[string match "*uuid:*$HASH*" $RESULT]}
127 fossil tag list --raw $HASH
128 test amend-bgcolor-2.2 {
129 [string first "bgcolor=" $RESULT] == -1 &&
130 [string first "bgcolor" $RESULT] != -1
131 }
@@ -147,11 +147,11 @@
147 if {![uuid_from_branch $RESULT HASH2]} {
148 test amend-branchcolor.setup false
149 }
150 fossil update $HASH2
151 fossil amend $HASH2 -branchcolor yellow
152 test amend-branchcolor-1.1 {[string match "*uuid:*$HASH2*" $RESULT]}
153 fossil tag ls --raw $HASH2
154 test amend-branchcolor-1.2 {[string first "bgcolor=yellow" $RESULT] != -1}
155 fossil timeline -n 1
156 test amend-branchcolor-1.3 {
157 [string match {*Change*branch*background*color*to*"yellow".*} $RESULT]
@@ -175,11 +175,11 @@
175 write_file datafile "bc1"
176 fossil commit -m "mc1"
177 write_file datafile "bc2"
178 fossil commit -m "mc2"
179 fossil amend $HASHN -branchcolor deadbe
180 test amend-branchcolor-2.1 {[string match "*uuid:*$HASHN*" $RESULT]}
181 fossil tag ls --raw current
182 test amend-branchcolor-2.2 {[string first "bgcolor=#deadbe" $RESULT] != -1}
183 fossil timeline -n 1
184 test amend-branchcolor-2.3 {
185 [string match {*Change*branch*background*color*to*"#deadbe".*} $RESULT]
@@ -201,11 +201,11 @@
201 set timestamp [clock scan yesterday]
202 set date [clock format $timestamp -format "%Y-%m-%d" -gmt 1]
203 set time [clock format $timestamp -format "%H:%M:%S" -gmt 1]
204 set datetime "$date $time"
205 fossil amend $HASHINIT -date $datetime
206 test amend-date-1.1 {[string match "*uuid:*$HASHINIT*$datetime*" $RESULT]}
207 fossil tag ls --raw $HASHINIT
208 test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1}
209 fossil timeline -n 1
210 test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]}
211 set badformats {
@@ -232,11 +232,11 @@
232 fossil branch new tohide current
233 if {![uuid_from_branch $RESULT HASHH]} {
234 test amend-hide-setup false
235 }
236 fossil amend $HASHH -hide
237 test amend-hide-1.1 {[string match "*uuid:*$HASHH*" $RESULT]}
238 fossil tag ls --raw $HASHH
239 test amend-hide-1.2 {[string first "hidden" $RESULT] != -1}
240 fossil timeline -n 1
241 test amend-hide-1.3 {[string match {*Add*propagating*"hidden".*} $RESULT]}
242
@@ -248,11 +248,11 @@
248 if {![uuid_from_branch $RESULT HASHC]} {
249 test amend-close.setup false
250 }
251 fossil update $HASHC
252 fossil amend $HASHC -close
253 test amend-close-1.1.a {[string match "*uuid:*$HASHC*" $RESULT]}
254 test amend-close-1.1.b {
255 [string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
256 }
257 fossil tag ls --raw $HASHC
258 test amend-close-1.2 {[string first "closed" $RESULT] != -1}
@@ -273,11 +273,11 @@
273 write_file datafile "b1"
274 fossil commit -m "m1"
275 write_file datafile "b2"
276 fossil commit -m "m2"
277 fossil amend $HASH3 --close
278 test amend-close-3.1 {[string match "*uuid:*$HASH3*" $RESULT]}
279 fossil tag ls --raw current
280 test amend-close-3.2 {[string first "closed" $RESULT] != -1}
281 fossil timeline -n 1
282 test amend-close-3.3 {
283 [string match "*Add*propagating*\"closed\".*" $RESULT]
@@ -311,11 +311,11 @@
311 append t2exp "sym-$res*"
312 append t3exp "Add*tag*\"$res\".*"
313 append t5exp "Cancel*tag*\"$res\".*"
314 }
315 eval fossil amend $HASH $tags
316 test amend-tag-$tc.1 {[string match "*uuid:*$HASH*tags:*$t1exp*" $RESULT]}
317 fossil tag ls --raw $HASH
318 test amend-tag-$tc.2 {[string match $t2exp $RESULT]}
319 fossil timeline -n 1
320 test amend-tag-$tc.3 {[string match $t3exp $RESULT]}
321 eval fossil amend $HASH $cancels
@@ -341,11 +341,11 @@
341
342 proc test-comment {name HASH comment} {
343 global VERBOSE RESULT
344
345 test amend-comment-$name.1 {
346 [string match "*uuid:*$HASH*comment:*$comment*" $RESULT]
347 }
348 fossil timeline -n 1
349 if {[artifact_from_timeline $RESULT artid]} {
350 fossil artifact $artid
351 test amend-comment-$name.2 {
@@ -359,11 +359,11 @@
359 test amend-comment-$name.3 {
360 [string match "*[short_uuid $HASH]*Edit*check-in*comment.*" $RESULT]
361 }
362 fossil info $HASH
363 test amend-comment-$name.4 {
364 [string match "*uuid:*$HASH*comment:*$comment*" $RESULT]
365 }
366 }
367
368 prep-test "revision 1" "revision 1"
369 fossil amend $HASH -comment "revised revision 1"
@@ -382,14 +382,11 @@
382 write_file commitmsg "revision 4 revised with -M"
383 fossil amend $HASH -M commitmsg
384 test-comment 4 $HASH "revision 4 revised with -M"
385
386 prep-test "final comment" "final content"
387 if {[catch {exec which ed} result]} {
388 if {$VERBOSE} { protOut "Install ed for interactive comment test: $result" }
389 test-comment 5 $HASH "ed required for interactive edit"
390 } else {
391 fossil settings editor "ed -s"
392 set comment "interactive edited comment"
393 fossil_maybe_answer "a\n$comment\n.\nw\nq\n" amend $HASH --edit-comment
394 test-comment 5 $HASH $comment
395 }
396
--- test/amend.test
+++ test/amend.test
@@ -103,11 +103,11 @@
103 1234 1234
104 123456 #123456
105 } {
106 incr tc
107 fossil amend $HASH -bgcolor $color
108 test amend-bgcolor-1.$tc.a {[string match "*hash:*$HASH*" $RESULT]}
109 fossil tag list --raw $HASH
110 test amend-bgcolor-1.$tc.b {[string first "bgcolor=$result" $RESULT] != -1}
111 fossil timeline -n 1
112 test amend-bgcolor-1.$tc.c {
113 [string match "*Change*background*color*to*\"$result\"*" $RESULT]
@@ -121,11 +121,11 @@
121 if {$VERBOSE} { protOut "No artifact found in timeline output" }
122 test amend-bgcolor-1.$tc.d false
123 }
124 }
125 fossil amend $HASH -bgcolor {}
126 test amend-bgcolor-2.1 {[string match "*hash:*$HASH*" $RESULT]}
127 fossil tag list --raw $HASH
128 test amend-bgcolor-2.2 {
129 [string first "bgcolor=" $RESULT] == -1 &&
130 [string first "bgcolor" $RESULT] != -1
131 }
@@ -147,11 +147,11 @@
147 if {![uuid_from_branch $RESULT HASH2]} {
148 test amend-branchcolor.setup false
149 }
150 fossil update $HASH2
151 fossil amend $HASH2 -branchcolor yellow
152 test amend-branchcolor-1.1 {[string match "*hash:*$HASH2*" $RESULT]}
153 fossil tag ls --raw $HASH2
154 test amend-branchcolor-1.2 {[string first "bgcolor=yellow" $RESULT] != -1}
155 fossil timeline -n 1
156 test amend-branchcolor-1.3 {
157 [string match {*Change*branch*background*color*to*"yellow".*} $RESULT]
@@ -175,11 +175,11 @@
175 write_file datafile "bc1"
176 fossil commit -m "mc1"
177 write_file datafile "bc2"
178 fossil commit -m "mc2"
179 fossil amend $HASHN -branchcolor deadbe
180 test amend-branchcolor-2.1 {[string match "*hash:*$HASHN*" $RESULT]}
181 fossil tag ls --raw current
182 test amend-branchcolor-2.2 {[string first "bgcolor=#deadbe" $RESULT] != -1}
183 fossil timeline -n 1
184 test amend-branchcolor-2.3 {
185 [string match {*Change*branch*background*color*to*"#deadbe".*} $RESULT]
@@ -201,11 +201,11 @@
201 set timestamp [clock scan yesterday]
202 set date [clock format $timestamp -format "%Y-%m-%d" -gmt 1]
203 set time [clock format $timestamp -format "%H:%M:%S" -gmt 1]
204 set datetime "$date $time"
205 fossil amend $HASHINIT -date $datetime
206 test amend-date-1.1 {[string match "*hash:*$HASHINIT*$datetime*" $RESULT]}
207 fossil tag ls --raw $HASHINIT
208 test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1}
209 fossil timeline -n 1
210 test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]}
211 set badformats {
@@ -232,11 +232,11 @@
232 fossil branch new tohide current
233 if {![uuid_from_branch $RESULT HASHH]} {
234 test amend-hide-setup false
235 }
236 fossil amend $HASHH -hide
237 test amend-hide-1.1 {[string match "*hash:*$HASHH*" $RESULT]}
238 fossil tag ls --raw $HASHH
239 test amend-hide-1.2 {[string first "hidden" $RESULT] != -1}
240 fossil timeline -n 1
241 test amend-hide-1.3 {[string match {*Add*propagating*"hidden".*} $RESULT]}
242
@@ -248,11 +248,11 @@
248 if {![uuid_from_branch $RESULT HASHC]} {
249 test amend-close.setup false
250 }
251 fossil update $HASHC
252 fossil amend $HASHC -close
253 test amend-close-1.1.a {[string match "*hash:*$HASHC*" $RESULT]}
254 test amend-close-1.1.b {
255 [string match "*comment:*Create*new*branch*named*\"cllf\"*" $RESULT]
256 }
257 fossil tag ls --raw $HASHC
258 test amend-close-1.2 {[string first "closed" $RESULT] != -1}
@@ -273,11 +273,11 @@
273 write_file datafile "b1"
274 fossil commit -m "m1"
275 write_file datafile "b2"
276 fossil commit -m "m2"
277 fossil amend $HASH3 --close
278 test amend-close-3.1 {[string match "*hash:*$HASH3*" $RESULT]}
279 fossil tag ls --raw current
280 test amend-close-3.2 {[string first "closed" $RESULT] != -1}
281 fossil timeline -n 1
282 test amend-close-3.3 {
283 [string match "*Add*propagating*\"closed\".*" $RESULT]
@@ -311,11 +311,11 @@
311 append t2exp "sym-$res*"
312 append t3exp "Add*tag*\"$res\".*"
313 append t5exp "Cancel*tag*\"$res\".*"
314 }
315 eval fossil amend $HASH $tags
316 test amend-tag-$tc.1 {[string match "*hash:*$HASH*tags:*$t1exp*" $RESULT]}
317 fossil tag ls --raw $HASH
318 test amend-tag-$tc.2 {[string match $t2exp $RESULT]}
319 fossil timeline -n 1
320 test amend-tag-$tc.3 {[string match $t3exp $RESULT]}
321 eval fossil amend $HASH $cancels
@@ -341,11 +341,11 @@
341
342 proc test-comment {name HASH comment} {
343 global VERBOSE RESULT
344
345 test amend-comment-$name.1 {
346 [string match "*hash:*$HASH*comment:*$comment*" $RESULT]
347 }
348 fossil timeline -n 1
349 if {[artifact_from_timeline $RESULT artid]} {
350 fossil artifact $artid
351 test amend-comment-$name.2 {
@@ -359,11 +359,11 @@
359 test amend-comment-$name.3 {
360 [string match "*[short_uuid $HASH]*Edit*check-in*comment.*" $RESULT]
361 }
362 fossil info $HASH
363 test amend-comment-$name.4 {
364 [string match "*hash:*$HASH*comment:*$comment*" $RESULT]
365 }
366 }
367
368 prep-test "revision 1" "revision 1"
369 fossil amend $HASH -comment "revised revision 1"
@@ -382,14 +382,11 @@
382 write_file commitmsg "revision 4 revised with -M"
383 fossil amend $HASH -M commitmsg
384 test-comment 4 $HASH "revision 4 revised with -M"
385
386 prep-test "final comment" "final content"
387 if {[catch {exec which ed} result] == 0} {
 
 
 
388 fossil settings editor "ed -s"
389 set comment "interactive edited comment"
390 fossil_maybe_answer "a\n$comment\n.\nw\nq\n" amend $HASH --edit-comment
391 test-comment 5 $HASH $comment
392 }
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