Skip to content

Commit 05002f6

Browse files
peffgitster
authored andcommitted
diff-highlight: check diff-highlight exit status in tests
When testing diff-highlight, we pipe the output through a sanitizing function. This loses the exit status of diff-highlight itself, which could mean we are missing cases where it crashes or exits unexpectedly. Use an extra tempfile to avoid the pipe. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 550097a commit 05002f6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

contrib/diff-highlight/t/t9400-diff-highlight.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ dh_test () {
4141
git show >commit.raw
4242
} >/dev/null &&
4343

44-
"$DIFF_HIGHLIGHT" <diff.raw | test_strip_patch_header >diff.act &&
45-
"$DIFF_HIGHLIGHT" <commit.raw | test_strip_patch_header >commit.act &&
44+
"$DIFF_HIGHLIGHT" <diff.raw >diff.hi &&
45+
test_strip_patch_header <diff.hi >diff.act &&
46+
"$DIFF_HIGHLIGHT" <commit.raw >commit.hi &&
47+
test_strip_patch_header <commit.hi >commit.act &&
4648
test_cmp patch.exp diff.act &&
4749
test_cmp patch.exp commit.act
4850
}

0 commit comments

Comments
 (0)