Skip to content

Commit c96050f

Browse files
Denton-Lgitster
authored andcommitted
t7107: don't use test_must_fail()
We had a `test_must_fail verify_expect`. However, the git command in verify_expect() was not expected to fail; the test_cmp() was the failing command. Be more precise about testing failure by accepting an optional first argument of '!' which causes the result of the file comparison to be negated. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6861ac8 commit c96050f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

t/t7107-reset-pathspec-file.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ restore_checkpoint () {
2222

2323
verify_expect () {
2424
git status --porcelain -- fileA.t fileB.t fileC.t fileD.t >actual &&
25-
test_cmp expect actual
25+
if test "x$1" = 'x!'
26+
then
27+
! test_cmp expect actual
28+
else
29+
test_cmp expect actual
30+
fi
2631
}
2732

2833
test_expect_success '--pathspec-from-file from stdin' '
@@ -131,7 +136,7 @@ test_expect_success 'quotes not compatible with --pathspec-file-nul' '
131136
cat >expect <<-\EOF &&
132137
D fileA.t
133138
EOF
134-
test_must_fail verify_expect
139+
verify_expect !
135140
'
136141

137142
test_expect_success 'only touches what was listed' '

0 commit comments

Comments
 (0)