File tree 2 files changed +26
-0
lines changed 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -548,6 +548,19 @@ library for your script to use.
548
548
...
549
549
'
550
550
551
+ - test_pause
552
+
553
+ This command is useful for writing and debugging tests and must be
554
+ removed before submitting. It halts the execution of the test and
555
+ spawns a shell in the trash directory. Exit the shell to continue
556
+ the test. Example:
557
+
558
+ test_expect_success 'test' '
559
+ git do-something >actual &&
560
+ test_pause &&
561
+ test_cmp expected actual
562
+ '
563
+
551
564
Prerequisites
552
565
-------------
553
566
Original file line number Diff line number Diff line change @@ -329,6 +329,19 @@ test_tick () {
329
329
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
330
330
}
331
331
332
+ # Stop execution and start a shell. This is useful for debugging tests and
333
+ # only makes sense together with "-v".
334
+ #
335
+ # Be sure to remove all invocations of this command before submitting.
336
+
337
+ test_pause () {
338
+ if test " $verbose " = t; then
339
+ " $SHELL_PATH " < & 6 >&3 2>&4
340
+ else
341
+ error >&5 " test_pause requires --verbose"
342
+ fi
343
+ }
344
+
332
345
# Call test_commit with the arguments "<message> [<file> [<contents>]]"
333
346
#
334
347
# This will commit a file with the given contents and the given commit
You can’t perform that action at this time.
0 commit comments