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

Re: [PATCH v2] apply: add unit tests for parse_range

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 7, 2024, 16:59 UTC
Message-ID
<xmqqo78celjy.fsf@gitster.g>
In-Reply-To
<b7eca313-9ea8-4132-ba1d-ed9236e07095@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 12 quoted lines
> Thanks for re-rolling, I've left a few comments below
> ...
> This is an example of why I don't think we should check p1 and p2 when
> we're expecting the parse to fail. Also please note we don't use "//"
> comments in the code base.
>
> There is a good range of failing non-digit inputs. It would be nice to
> see a test for a hunk header where the number is too large to
> parse. Ideally we'd also change the parsing code to return an error in
> that case rather than waiting to error out later on as the apply code
> does currently. To do that You'd need to explicitly set errno to zero
> before calling strtoul() and check it afterwards.
Thanks.  All points you raised make quite a lot of sense to me.
Previous: Phillip Wood
Message 12 of 12 in “apply: add unit tests for parse_range”
  1. 0/2 apply: add unit tests for parse_rangePhilip Peterson via GitGitGadget, Feb 19, 2024
  2. 1/2 apply: add unit tests for parse_range and rename to parse_fragment_rangePhilip Peterson via GitGitGadget, Feb 19, 2024
  3. Junio C HamanoFeb 19, 2024
  4. PhilipApr 4, 2024
  5. Junio C HamanoApr 4, 2024
  6. 2/2 apply: rewrite unit tests with structured casesPhilip Peterson via GitGitGadget, Feb 19, 2024
  7. Junio C HamanoFeb 19, 2024
  8. Kristoffer HaugsbakkFeb 19, 2024
  9. apply: add unit tests for parse_rangePhilip Peterson via GitGitGadget, May 26, 2024
  10. Junio C HamanoJun 6, 2024
  11. Phillip WoodJun 7, 2024
  12. Junio C HamanoJun 7, 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.