mbox series

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

Message ID pull.1677.git.git.1708317938.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series apply: add unit tests for parse_range | expand

Message

Philippe Blain via GitGitGadget Feb. 19, 2024, 4:45 a.m. UTC
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