Fossil SCM
Update amend.test to use fake-editor.tcl same as unversioned.test does.
Commit
3cb48d20d8400115519ded8d70b8f5a74e717fb23b9cf1a2bfe21888d27d439d
Parent
c73f906ec0aaa15…
1 file changed
+7
-6
+7
-6
| --- test/amend.test | ||
| +++ test/amend.test | ||
| @@ -383,16 +383,17 @@ | ||
| 383 | 383 | write_file commitmsg "revision 4 revised with -M" |
| 384 | 384 | fossil amend $HASH -M commitmsg |
| 385 | 385 | test-comment 4 $HASH "revision 4 revised with -M" |
| 386 | 386 | |
| 387 | 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 | -} | |
| 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 | |
| 394 | 395 | |
| 395 | 396 | ######################################## |
| 396 | 397 | # Test: NULL hash # |
| 397 | 398 | ######################################## |
| 398 | 399 | fossil amend {} -close -expectError |
| 399 | 400 |
| --- 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 |