Re: [PATCH] test-lib: catch misspelt 'test_expect_successo'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 24, 2026, 19:48 UTC
- Message-ID
- <xmqqy0jhxb3r.fsf@gitster.g>
- In-Reply-To
- <20260324193514.GA1870130@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> On Tue, Mar 24, 2026 at 11:13:26AM -0700, Junio C Hamano wrote: > >> In order to catch mistakes like misspelling "test_expect_success", >> we would like to eventually be able to run our test suite with the >> "-e" option on. > > 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 ;-)
Show 5 quoted lines
> In the past I've caught errors outside of the test snippet by noticing > cruft on stderr. This is especially obvious if you use "prove", which > captures stdout and gives a nice display (which the extra stderr then > makes uglier). > I wonder if we could automate / formalize that.
That's a thought.