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

Re: [Outreachy][PATCH v5] Port helper/test-ctype.c to unit-tests/t-ctype.c

From
Josh Steadmon <steadmon@google.com>
Date
Jan 17, 2024, 05:37 UTC
Message-ID
<ZadnhRtYfrFeMCbX@google.com>
In-Reply-To
<41cf1944-2456-4115-a934-aff2306a26e5@web.de>
On 2024.01.16 20:27, René Scharfe wrote:
Show 14 quoted lines
> Am 16.01.24 um 16:38 schrieb Junio C Hamano:
> > Phillip Wood <phillip.wood123@gmail.com> writes:
> >
> >> Thanks for adding back the test for EOF, this version looks good to me.
> >
> > Thanks.  Let's merge it to 'next'.
> 
> OK.  I'm still interested in replies to my question in
> https://lore.kernel.org/git/a087f57c-ce72-45c7-8182-f38d0aca9030@web.de/,
> i.e. whether we should have one TEST per class or one per class and
> character -- or in a broader sense: What's the ideal scope of a TEST?
> But I can ask it again in the form of a follow-up patch.
> 
> René

I think that the scope of a TEST() should tend small: we want the minimal amount of setup required to test the invariants that we're interested in. For this particular unit test, since we're just testing simple predicates on static sets of characters, I would be OK seeing one TEST() per class/character. That would certainly make this unit test an outlier in the number of checks, but I'm less worried about that since this is testing system-provided functions that we don't expect to change regularly.

Additionally, the elimination of a level of macro indirection makes this more readable IMO.

Previous: Junio C Hamano
Message 24 of 24 in “Port helper/test-ctype.c to unit-tests/t-ctype.c”
  1. Port helper/test-ctype.c to unit-tests/t-ctype.cAchu Luma, Dec 21, 2023
  2. Junio C HamanoDec 26, 2023
  3. Christian CouderDec 27, 2023
  4. René ScharfeDec 27, 2023
  5. Phillip WoodDec 27, 2023
  6. Junio C HamanoDec 27, 2023
  7. René ScharfeDec 28, 2023
  8. Taylor BlauJan 2, 2024
  9. [Outreachy][PATCH v2] Port helper/test-ctype.c to unit-tests/t-ctype.cAchu Luma, Dec 30, 2023
  10. [Outreachy][PATCH v3] Port helper/test-ctype.c to unit-tests/t-ctype.cAchu Luma, Jan 1, 2024
  11. René ScharfeJan 1, 2024
  12. Junio C HamanoJan 2, 2024
  13. [Outreachy][PATCH v4] Port helper/test-ctype.c to unit-tests/t-ctype.cAchu Luma, Jan 5, 2024
  14. René ScharfeJan 7, 2024
  15. Junio C HamanoJan 8, 2024
  16. Phillip WoodJan 9, 2024
  17. Junio C HamanoJan 9, 2024
  18. [Outreachy][PATCH v5] Port helper/test-ctype.c to unit-tests/t-ctype.cAchu Luma, Jan 12, 2024
  19. Phillip WoodJan 15, 2024
  20. Junio C HamanoJan 16, 2024
  21. René ScharfeJan 16, 2024
  22. Christian CouderJan 16, 2024
  23. Junio C HamanoJan 16, 2024
  24. Josh SteadmonJan 17, 2024

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.