Fossil SCM

Update amend.test to use fake-editor.tcl same as unversioned.test does.

danshearer 2026-11-17 22:44 UTC test-suite-new
Commit 3cb48d20d8400115519ded8d70b8f5a74e717fb23b9cf1a2bfe21888d27d439d
1 file changed +7 -6
+7 -6
--- test/amend.test
+++ test/amend.test
@@ -383,16 +383,17 @@
383383
write_file commitmsg "revision 4 revised with -M"
384384
fossil amend $HASH -M commitmsg
385385
test-comment 4 $HASH "revision 4 revised with -M"
386386
387387
prep-test "final comment" "final content"
388
-if {[catch {exec which ed} result] == 0} {
389
- fossil settings editor "ed -s"
390
- set comment "interactive edited comment"
391
- fossil_maybe_answer "a\n$comment\n.\nw\nq\n" amend $HASH --edit-comment
392
- test-comment 5 $HASH $comment
393
-}
388
+fossil settings editor [appendArgs \
389
+ [info nameofexecutable] " " [file join $testfiledir fake-editor.tcl]]
390
+set comment "interactive edited comment"
391
+set env(FAKE_EDITOR_SCRIPT) [list set data $comment]
392
+fossil amend $HASH --edit-comment
393
+unset env(FAKE_EDITOR_SCRIPT)
394
+test-comment 5 $HASH $comment
394395
395396
########################################
396397
# Test: NULL hash #
397398
########################################
398399
fossil amend {} -close -expectError
399400
--- test/amend.test
+++ test/amend.test
@@ -383,16 +383,17 @@
383 write_file commitmsg "revision 4 revised with -M"
384 fossil amend $HASH -M commitmsg
385 test-comment 4 $HASH "revision 4 revised with -M"
386
387 prep-test "final comment" "final content"
388 if {[catch {exec which ed} result] == 0} {
389 fossil settings editor "ed -s"
390 set comment "interactive edited comment"
391 fossil_maybe_answer "a\n$comment\n.\nw\nq\n" amend $HASH --edit-comment
392 test-comment 5 $HASH $comment
393 }
 
394
395 ########################################
396 # Test: NULL hash #
397 ########################################
398 fossil amend {} -close -expectError
399
--- test/amend.test
+++ test/amend.test
@@ -383,16 +383,17 @@
383 write_file commitmsg "revision 4 revised with -M"
384 fossil amend $HASH -M commitmsg
385 test-comment 4 $HASH "revision 4 revised with -M"
386
387 prep-test "final comment" "final content"
388 fossil settings editor [appendArgs \
389 [info nameofexecutable] " " [file join $testfiledir fake-editor.tcl]]
390 set comment "interactive edited comment"
391 set env(FAKE_EDITOR_SCRIPT) [list set data $comment]
392 fossil amend $HASH --edit-comment
393 unset env(FAKE_EDITOR_SCRIPT)
394 test-comment 5 $HASH $comment
395
396 ########################################
397 # Test: NULL hash #
398 ########################################
399 fossil amend {} -close -expectError
400

Keyboard Shortcuts

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