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

Re: [RFC PATCH 0/1] Unit tests for khash.h

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2023, 06:26 UTC
Message-ID
<xmqqr0qvbsvp.fsf@gitster.g>
In-Reply-To
<ZHfLwpX7nNVjBvE5@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 17 quoted lines
> Hi Siddharth,
>
> On Wed, May 31, 2023 at 05:51:41PM +0200, Siddharth Singh wrote:
>> This RFC patch adds unit tests for khash.h. It uses the C TAP harness
>> to illustrate the test cases [1]. This is not intended to be a
>> complete implementation. The purpose of this patch to get your
>> thoughts on the unit test content, not the test framework itself.
>
> Thanks for working on this, and for opening the discussion up. I took
> only a brief look through the actual changes. But I think the much more
> interesting discussion is on the approach, so I'll refrain from
> commenting on the tests themselves.
>
> I am somewhat skeptical of this as a productive direction, primarily
> because khash already has tests [1] that exercise its functionality. I'm
> not necessarily opposed to (light) testing of oid_set, oid_map, and
> oid_pos, which are khash structures, but declared by Git.

Yes, as a fairly isolated and supposedly well tested piece of code, using khash as a guinea pig for the technology demonstration of C TAP harness they propose to use would be an excellent choice, and I found the request not to talk about the harness quite odd. It felt almost pointless.

The "main()" did illustrate a few things people found problematic with the harness, among which having to declare plan(9) upfront. An obvious disregard of the coding guidelines did not help well, either. Overall, I am not impressed.

Thanks.
Previous: Taylor BlauNext: Phillip Wood
Message 4 of 12 in “Unit tests for khash.h”
  1. 0/1 Unit tests for khash.hSiddharth Singh, May 31, 2023
  2. 1/1 khash_test.c: add unit testsSiddharth Singh, May 31, 2023
  3. Taylor BlauMay 31, 2023
  4. Junio C HamanoJun 1, 2023
  5. Phillip WoodJun 1, 2023
  6. Eric WongMay 31, 2023
  7. Phillip WoodJun 1, 2023
  8. khash_test.c : add unit testsSiddharth Singh, Jun 27, 2023
  9. Glen ChooJun 30, 2023
  10. Siddharth SinghJul 7, 2023
  11. Glen ChooJul 7, 2023
  12. Glen ChooJun 30, 2023

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.