File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -655,19 +655,29 @@ library for your script to use.
655655 test_expect_code 1 git merge "merge msg" B master
656656 '
657657
658- - test_must_fail <git-command>
658+ - test_must_fail [<options>] <git-command>
659659
660660 Run a git command and ensure it fails in a controlled way. Use
661661 this instead of "! <git-command>". When git-command dies due to a
662662 segfault, test_must_fail diagnoses it as an error; "! <git-command>"
663663 treats it as just another expected failure, which would let such a
664664 bug go unnoticed.
665665
666- - test_might_fail <git-command>
666+ Accepts the following options:
667+
668+ ok=<signal-name>[,<...>]:
669+ Don't treat an exit caused by the given signal as error.
670+ Multiple signals can be specified as a comma separated list.
671+ Currently recognized signal names are: sigpipe, success.
672+ (Don't use 'success', use 'test_might_fail' instead.)
673+
674+ - test_might_fail [<options>] <git-command>
667675
668676 Similar to test_must_fail, but tolerate success, too. Use this
669677 instead of "<git-command> || :" to catch failures due to segv.
670678
679+ Accepts the same options as test_must_fail.
680+
671681 - test_cmp <expected> <actual>
672682
673683 Check whether the content of the <actual> file matches the
Original file line number Diff line number Diff line change @@ -610,6 +610,14 @@ list_contains () {
610610#
611611# Writing this as "! git checkout ../outerspace" is wrong, because
612612# the failure could be due to a segv. We want a controlled failure.
613+ #
614+ # Accepts the following options:
615+ #
616+ # ok=<signal-name>[,<...>]:
617+ # Don't treat an exit caused by the given signal as error.
618+ # Multiple signals can be specified as a comma separated list.
619+ # Currently recognized signal names are: sigpipe, success.
620+ # (Don't use 'success', use 'test_might_fail' instead.)
613621
614622test_must_fail () {
615623 case " $1 " in
@@ -656,6 +664,8 @@ test_must_fail () {
656664#
657665# Writing "git config --unset all.configuration || :" would be wrong,
658666# because we want to notice if it fails due to segv.
667+ #
668+ # Accepts the same options as test_must_fail.
659669
660670test_might_fail () {
661671 test_must_fail ok=success " $@ "
You can’t perform that action at this time.
0 commit comments