Re: [PATCH v2 2/6] unit-tests: add for_test
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 23, 2024, 13:00 UTC
- Message-ID
- <Zp-pVsWeTCbfcquh@tanuki>
- In-Reply-To
- <0af06e8e-e1d7-4cf6-b968-5dad5f4fef2e@web.de>
On Tue, Jul 23, 2024 at 02:37:35PM +0200, René Scharfe wrote:
Show 14 quoted lines
> Am 23.07.24 um 11:53 schrieb Patrick Steinhardt: > > On Tue, Jul 23, 2024 at 11:25:29AM +0200, René Scharfe wrote: > >> Am 23.07.24 um 08:36 schrieb Patrick Steinhardt: > >>> There is of course some magic involved with how we generate the file. > >> > >> It requires magic function names and generates code using a different > >> language, while for_test is a just single new control flow keyword, > >> like the dozen or so we already have. So the magic employed by the > >> libgit2 system is both broader and deeper. > > > > It is broader, that's certainly true. But it feels more self-contained, > > less fragile and easier to read to me compared to macros. > > In which ways can for_test break?
I was mostly referring to the potential for empty-by-accident test bodies that were mentioned in other parts of this thread.
Patrick