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 @@ -658,19 +658,29 @@ library for your script to use.
658
658
test_expect_code 1 git merge "merge msg" B master
659
659
'
660
660
661
- - test_must_fail <git-command>
661
+ - test_must_fail [<options>] <git-command>
662
662
663
663
Run a git command and ensure it fails in a controlled way. Use
664
664
this instead of "! <git-command>". When git-command dies due to a
665
665
segfault, test_must_fail diagnoses it as an error; "! <git-command>"
666
666
treats it as just another expected failure, which would let such a
667
667
bug go unnoticed.
668
668
669
- - test_might_fail <git-command>
669
+ Accepts the following options:
670
+
671
+ ok=<signal-name>[,<...>]:
672
+ Don't treat an exit caused by the given signal as error.
673
+ Multiple signals can be specified as a comma separated list.
674
+ Currently recognized signal names are: sigpipe, success.
675
+ (Don't use 'success', use 'test_might_fail' instead.)
676
+
677
+ - test_might_fail [<options>] <git-command>
670
678
671
679
Similar to test_must_fail, but tolerate success, too. Use this
672
680
instead of "<git-command> || :" to catch failures due to segv.
673
681
682
+ Accepts the same options as test_must_fail.
683
+
674
684
- test_cmp <expected> <actual>
675
685
676
686
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