git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] test-lib-functions: use BUG() in 'test_must_fail'

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2026, 15:25 UTC
Message-ID
<xmqqeckg8cun.fsf@gitster.g>
In-Reply-To
<20260414221807.GB3475104@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 20 quoted lines
> I think the main value of both (but especially test_might_fail) is that
> they slot naturally into &&-chains. I left a similar comment in that
> other thread, but to expand a bit, if you do:
>
>   false &&
>   true || : &&
>   echo everything ok
>
> you will get "everything ok", even though step 1 failed. You need:
>
>   false &&
>   { true || : } &&
>   echo everything ok
>
> except that because it is shell you have to add an extra semicolon after
> the ":". ;)
>
> Syntax-complaints aside, I think it is a very easy thing for
> contributors to get wrong. So I think test_might_fail has value, though
> I do not care if it has a different name.
Yup, I recall that I recently said that I hate that semicolon ;-)
Previous: Jeff KingNext: Jeff King
Message 10 of 13 in “tests: don't mess with fd 7 of test helper functions”
  1. 1/2 tests: don't mess with fd 7 of test helper functionsSZEDER Gábor, Feb 21, 2021
  2. 2/2 test-lib-functions: use BUG() in 'test_must_fail'SZEDER Gábor, Feb 21, 2021
  3. Jeff KingFeb 21, 2021
  4. Jeff KingFeb 22, 2021
  5. Jeff KingFeb 22, 2021
  6. Junio C HamanoFeb 22, 2021
  7. SZEDER GáborApr 14, 2026
  8. Junio C HamanoApr 14, 2026
  9. Jeff KingApr 14, 2026
  10. Junio C HamanoApr 15, 2026
  11. Jeff KingApr 14, 2026
  12. Jeff KingFeb 21, 2021
  13. Junio C HamanoFeb 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.