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

[PATCH 0/2] apply: add unit tests for parse_range

From
PGPhilip Peterson via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 19, 2024, 04:45 UTC
Message-ID
<pull.1677.git.git.1708317938.gitgitgadget@gmail.com>
Hello all,

This patchset adds unit tests for apply's parse_range function. Also renames parse_range to parse_fragment_range.

It was necessary to make the function be non-internal linkage in order to expose it to the unit testing framework. Because there is another function in the codebase also called parse_range, I changed this one to a more specific name as well: parse_fragment_range. There are also several test cases added (both positive and negative) for the function.

Thank you for your help,
Philip
Philip Peterson (2):
  apply: add unit tests for parse_range and rename to
    parse_fragment_range
  apply: rewrite unit tests with structured cases
 Makefile               |   1 +
 apply.c                |   8 ++--
 apply.h                |   4 ++
 t/unit-tests/t-apply.c | 100 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 109 insertions(+), 4 deletions(-)
 create mode 100644 t/unit-tests/t-apply.c
base-commit: 186b115d3062e6230ee296d1ddaa0c4b72a464b5
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1677%2Fphilip-peterson%2Fpeterson%2Funit-tests-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1677/philip-peterson/peterson/unit-tests-v1
Pull-Request: https://github.com/git/git/pull/1677
-- 
gitgitgadget
Next: Philip Peterson via GitGitGadget
Message 1 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.