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.
655
655
test_expect_code 1 git merge "merge msg" B master
656
656
'
657
657
658
- - test_must_fail <git-command>
658
+ - test_must_fail [<options>] <git-command>
659
659
660
660
Run a git command and ensure it fails in a controlled way. Use
661
661
this instead of "! <git-command>". When git-command dies due to a
662
662
segfault, test_must_fail diagnoses it as an error; "! <git-command>"
663
663
treats it as just another expected failure, which would let such a
664
664
bug go unnoticed.
665
665
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>
667
675
668
676
Similar to test_must_fail, but tolerate success, too. Use this
669
677
instead of "<git-command> || :" to catch failures due to segv.
670
678
679
+ Accepts the same options as test_must_fail.
680
+
671
681
- test_cmp <expected> <actual>
672
682
673
683
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 () {
610
610
#
611
611
# Writing this as "! git checkout ../outerspace" is wrong, because
612
612
# 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.)
613
621
614
622
test_must_fail () {
615
623
case " $1 " in
@@ -656,6 +664,8 @@ test_must_fail () {
656
664
#
657
665
# Writing "git config --unset all.configuration || :" would be wrong,
658
666
# because we want to notice if it fails due to segv.
667
+ #
668
+ # Accepts the same options as test_must_fail.
659
669
660
670
test_might_fail () {
661
671
test_must_fail ok=success " $@ "
You can’t perform that action at this time.
0 commit comments