From: Jeff King Date: Tue, 14 Apr 2026 22:14:29 GMT Subject: Re: [PATCH 2/2] test-lib-functions: use BUG() in 'test_must_fail' Message-ID: <20260414221429.GA3475104@coredump.intra.peff.net> In-Reply-To: On Tue, Apr 14, 2026 at 10:52:33PM +0200, SZEDER Gábor wrote: > On Sun, Feb 21, 2021 at 04:58:23PM -0500, Jeff King wrote: > > On Sun, Feb 21, 2021 at 08:25:12PM +0100, SZEDER Gábor wrote: > > > > > In many test helper functions we verify that they were invoked with > > > sensible parameters, and call BUG() to abort the test script when the > > > parameters are buggy. 6a67c75948 (test-lib-functions: restrict > > > test_must_fail usage, 2020-07-07) added such a parameter verification > > > to 'test_must_fail', but it didn't report the error with BUG(), like > > > we usually do. > > > > OK. I do not care all that much between BUG() and not-BUG here, since we > > are unlikely to have a test where test_must_fail returning 0 yields > > success. I guess the most interesting outcome is that we would notice a > > bug in a test_expect_failure block. > > If I had managed to send a new version of this patch series in the > last 5 years :), then this would have caught the issue noted in: > > https://public-inbox.org/git/ad6hovxCkwMTG11U@szeder.dev/ Looking at that old thread, I do not see any reason you should not re-send it (with or without the cosmetic fixups I suggested on top). -Peff