git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Seyi Kuforiji <kuforiji98@gmail.com>,
	git@vger.kernel.org, phillip.wood@dunelm.org.uk
Subject: Re: [PATCH 1/2] t/unit-tests: match functions signature with trailing code
Date: Wed, 8 Jan 2025 17:15:38 +0100	[thread overview]
Message-ID: <Z36kqlcKl20AkJvW@pks.im> (raw)
In-Reply-To: <xmqqcygxpbpy.fsf@gitster.g>

On Wed, Jan 08, 2025 at 07:27:37AM -0800, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > So I agree with you, let's scrap the idea and have proper function
> > bodies instead.
> 
> Yup, sometimes, simple, stupid, and good enough is the way to go.
> 
> We could do
> 
> -- >8 --
> 
> #define T(testname, input, expect1, expect256) \
> 	void test_hash__ ## testname(void) \
> 	{ \
> 		const char *expect[] = { expect1, expect256 }; \
> 		check_hash_data(input, strlen(input), expect); \
> 	} extern void test_hash__ ## testname()
> 
> T(empty_string, "", "da39...", "e3b0c4...");
> T(single_character, "a", "86f7e4...", "ca97811...");
> 
> -- 8< --
> 
> which may not upset syntax-aware editors too much.
> 
> Unless there are more than several dozens of them, I do not think it
> is worth it, though ;-)

Agreed, I'd go with the simple solution for now, which is to have
function bodies.

Patrick

  reply	other threads:[~2025-01-08 16:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-07  9:19 [PATCH 0/2] t/unit-tests: convert hash tests to use clar Seyi Kuforiji
2025-01-07  9:19 ` [PATCH 1/2] t/unit-tests: match functions signature with trailing code Seyi Kuforiji
2025-01-07 18:16   ` Junio C Hamano
2025-01-07 18:41     ` Junio C Hamano
2025-01-08  6:14     ` Patrick Steinhardt
2025-01-08  8:31       ` Seyi Chamber
2025-01-08 15:27       ` Junio C Hamano
2025-01-08 16:15         ` Patrick Steinhardt [this message]
2025-01-07  9:19 ` [PATCH 2/2] t/unit-tests: convert hash to use clar test framework Seyi Kuforiji
2025-01-08 12:03 ` [PATCH v2 0/1] " Seyi Kuforiji
2025-01-08 12:03   ` [PATCH v2 1/1] " Seyi Kuforiji
2025-01-08 15:35     ` Junio C Hamano
2025-01-09  7:30       ` Seyi Chamber
2025-01-08 15:28   ` [PATCH v2 0/1] " Junio C Hamano
2025-01-09  7:21     ` Seyi Chamber
2025-01-09 14:09   ` [PATCH v3] " Seyi Kuforiji
2025-01-09 15:10     ` Patrick Steinhardt
2025-01-09 16:14     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z36kqlcKl20AkJvW@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kuforiji98@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).