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

Re: [PATCH] test-lib: catch misspelt 'test_expect_successo'

From
Jeff King <peff@peff.net>
Date
Mar 25, 2026, 05:46 UTC
Message-ID
<20260325054601.GA3701549@coredump.intra.peff.net>
In-Reply-To
<xmqqy0jhxb3r.fsf@gitster.g>
On Tue, Mar 24, 2026 at 12:48:24PM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> > Using "-e" makes me very nervous, given all of its quirks. Granted, most
> > of them are related to it _not_ kicking in when you'd want it to, but I
> > worry it will create false positive/negative headaches.
> 
> After looking at a few scripts, I am not suffering from such
> headaches yet; it does not look too bad.  I'll stop this effort for
> now, but with a handful of patches I already sent, more than 80-90%
> of the entire test scripts that I run are now "set -e" clean, I
> think.  Note that I do not run svn, cvs, or p4 tests ;-)

Clean in the sense that you don't _notice_ any problems. But there may be lurking ones. For example, given this:

  set -e
  foo() {
	false
	echo foo
  }
what would you expect the output to be for:
  echo before &&
  foo &&
  echo after
versus:
  echo before &&
  foo

Whether that "false" triggers "-e" depends on where in the &&-chain the call to the containing function is. So things that are not problems now may suddenly become ones when far-away code is changed.

Maybe it's enough that people would notice and debug them when they happen (if "set -e" is in test-lib.sh), and they wouldn't come up all that much. I dunno. I just have been bitten enough by "-e" quirks that I'm wary.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 16 in “t4014: fix call to `test_expect_success ()`”
  1. t4014: fix call to `test_expect_success ()`Patrick Steinhardt, Mar 24, 2026
  2. Mirko FainaMar 24, 2026
  3. Junio C HamanoMar 24, 2026
  4. Mirko FainaMar 24, 2026
  5. Junio C HamanoMar 24, 2026
  6. Re* [PATCH] t4014: fix call to `test_expect_success ()`Junio C Hamano, Mar 24, 2026
  7. t6002: make test "set -e" cleanJunio C Hamano, Mar 24, 2026
  8. test-lib: catch misspelt 'test_expect_successo'Junio C Hamano, Mar 24, 2026
  9. Jeff KingMar 24, 2026
  10. Junio C HamanoMar 24, 2026
  11. Jeff KingMar 25, 2026
  12. t0008: make test "set -e" cleanJunio C Hamano, Mar 24, 2026
  13. t7450: make test "set -e" cleanJunio C Hamano, Mar 24, 2026
  14. Eric SunshineMar 24, 2026
  15. Junio C HamanoMar 24, 2026
  16. Patrick SteinhardtMar 25, 2026

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.