summaryrefslogtreecommitdiff
path: root/t/t5550-http-fetch-dumb.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-20 10:11:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-20 17:20:16 (GMT)
commit35da1bf5d6d51fe62d4d646c306c5cf5182a881e (patch)
treea86eeec53a49af851fc87b82d6a2529b4798cdfa /t/t5550-http-fetch-dumb.sh
parenta6a4a88af0b99fec688f66256a2c23a15e110c1f (diff)
downloadgit-35da1bf5d6d51fe62d4d646c306c5cf5182a881e.zip
git-35da1bf5d6d51fe62d4d646c306c5cf5182a881e.tar.gz
git-35da1bf5d6d51fe62d4d646c306c5cf5182a881e.tar.bz2
t: use test_might_fail for diff and grep
Some tests run diff or grep to produce an output, and then compare the output to an expected value. We know the exit code we expect these processes to have (e.g., grep yields 0 if it produced output and 1 otherwise), so it would not make the test wrong to look for it. But the difference between their output and the expected output (e.g., shown by test_cmp) is much more useful to somebody debugging the test than the test just bailing out. These tests break the &&-chain to skip the exit-code check of the process. However, we can get the same effect by using test_might_fail. Note that in some cases the test did use "|| return 1", which meant the test was not wrong, but it did fool --chain-lint. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5550-http-fetch-dumb.sh')
-rwxr-xr-xt/t5550-http-fetch-dumb.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh
index 61e087e..3d11b7a 100755
--- a/t/t5550-http-fetch-dumb.sh
+++ b/t/t5550-http-fetch-dumb.sh
@@ -184,8 +184,8 @@ test_expect_success 'fetch can handle previously-fetched .idx files' '
'
test_expect_success 'did not use upload-pack service' '
- grep '/git-upload-pack' <"$HTTPD_ROOT_PATH"/access.log >act
- : >exp
+ test_might_fail grep '/git-upload-pack' <"$HTTPD_ROOT_PATH"/access.log >act &&
+ : >exp &&
test_cmp exp act
'