aboutsummaryrefslogtreecommitdiff
path: root/tests/test-coverage-core--intersect.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-22 17:07:07 -0500
committerCraig Jennings <c@cjennings.net>2026-04-22 17:07:07 -0500
commit67a5b31bdb1d41e6e9496d997e2d0c1f0e71743c (patch)
tree93fe62d3696612a5690b508494274b0d524b172b /tests/test-coverage-core--intersect.el
parent52d235b3c8ff31ebab05fa45650443b0a28ddb54 (diff)
downloaddotemacs-67a5b31bdb1d41e6e9496d997e2d0c1f0e71743c.tar.gz
dotemacs-67a5b31bdb1d41e6e9496d997e2d0c1f0e71743c.zip
feat(coverage): add changed-lines helper and diff parser
Second of three pure helpers for the coverage-report command. cj/--coverage-parse-diff-output is pure. It takes a git unified-diff string and returns a hash table of file to set of added or modified line numbers (based on the +new_start,new_count hunk headers). Files with deletion-only hunks appear in the result with an empty set, so reporters can distinguish "coverage not tracked" from "no changes touched this file." cj/--coverage-changed-lines wraps that parser with scope dispatch. Scopes are working-tree, staged, branch-vs-main, and branch-vs-parent. Branch-vs-parent takes an optional BASE arg; if omitted, falls back to @{upstream}. Unknown scopes signal user-error. Tests cover Normal (single hunk, multiple files), Boundary (new file via @@ -0,0, deletion-only, binary markers, single-line hunks without a count, empty input), and Error (malformed hunk headers skipped; unknown scope). Git invocation is stubbed via cl-letf in the smoke test so the parser logic is exercised without shelling out. Part of the coverage-core work per docs/design/coverage.org.
Diffstat (limited to 'tests/test-coverage-core--intersect.el')
0 files changed, 0 insertions, 0 deletions