Fossil SCM

Use join instead to avoid prepending garbage at the beginning of the string.

andybradford 2024-04-25 13:34 trunk
Commit 4d556700a71df910f09e0d4e2f8d091e6d1494fe5a4531b0e2a3233fe6838242
1 file changed +1 -3
+1 -3
--- test/amend.test
+++ test/amend.test
@@ -296,28 +296,26 @@
296296
set tc 0
297297
foreach {tagt result} $tagtests {
298298
incr tc
299299
set tags {}
300300
set cancels {}
301
- set t1exp ""
301
+ set t1exp [join $results ", "]
302302
set t2exp "*"
303303
set t3exp "*"
304304
set t5exp "*"
305305
foreach tag $tagt {
306306
lappend tags -tag $tag
307307
lappend cancels -cancel $tag
308308
}
309309
foreach res $result {
310
- append t1exp ", $res"
311310
append t3exp "Add*tag*\"$res\".*"
312311
append t5exp "Cancel*tag*\"$res\".*"
313312
}
314313
foreach res [lsort -nocase $result] {
315314
append t2exp "sym-$res*"
316315
}
317316
eval fossil amend $HASH $tags
318
- set t1exp [string trimleft $t1exp ,]
319317
test amend-tag-$tc.1 {[string match "*hash:*$HASH*tags:*$t1exp*" $RESULT]}
320318
fossil tag ls --raw $HASH
321319
test amend-tag-$tc.2 {[string match $t2exp $RESULT]}
322320
fossil timeline -n 1
323321
test amend-tag-$tc.3 {[string match $t3exp $RESULT]}
324322
--- test/amend.test
+++ test/amend.test
@@ -296,28 +296,26 @@
296 set tc 0
297 foreach {tagt result} $tagtests {
298 incr tc
299 set tags {}
300 set cancels {}
301 set t1exp ""
302 set t2exp "*"
303 set t3exp "*"
304 set t5exp "*"
305 foreach tag $tagt {
306 lappend tags -tag $tag
307 lappend cancels -cancel $tag
308 }
309 foreach res $result {
310 append t1exp ", $res"
311 append t3exp "Add*tag*\"$res\".*"
312 append t5exp "Cancel*tag*\"$res\".*"
313 }
314 foreach res [lsort -nocase $result] {
315 append t2exp "sym-$res*"
316 }
317 eval fossil amend $HASH $tags
318 set t1exp [string trimleft $t1exp ,]
319 test amend-tag-$tc.1 {[string match "*hash:*$HASH*tags:*$t1exp*" $RESULT]}
320 fossil tag ls --raw $HASH
321 test amend-tag-$tc.2 {[string match $t2exp $RESULT]}
322 fossil timeline -n 1
323 test amend-tag-$tc.3 {[string match $t3exp $RESULT]}
324
--- test/amend.test
+++ test/amend.test
@@ -296,28 +296,26 @@
296 set tc 0
297 foreach {tagt result} $tagtests {
298 incr tc
299 set tags {}
300 set cancels {}
301 set t1exp [join $results ", "]
302 set t2exp "*"
303 set t3exp "*"
304 set t5exp "*"
305 foreach tag $tagt {
306 lappend tags -tag $tag
307 lappend cancels -cancel $tag
308 }
309 foreach res $result {
 
310 append t3exp "Add*tag*\"$res\".*"
311 append t5exp "Cancel*tag*\"$res\".*"
312 }
313 foreach res [lsort -nocase $result] {
314 append t2exp "sym-$res*"
315 }
316 eval fossil amend $HASH $tags
 
317 test amend-tag-$tc.1 {[string match "*hash:*$HASH*tags:*$t1exp*" $RESULT]}
318 fossil tag ls --raw $HASH
319 test amend-tag-$tc.2 {[string match $t2exp $RESULT]}
320 fossil timeline -n 1
321 test amend-tag-$tc.3 {[string match $t3exp $RESULT]}
322

Keyboard Shortcuts

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