aboutsummaryrefslogtreecommitdiff
path: root/tests/test-coverage-core--backend-registry.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
commit6a418bc6beb60f36d2655ba3d3e98e1033f16cb7 (patch)
treed023819810039e46a63f73a5673692fd0510033e /tests/test-coverage-core--backend-registry.el
parentb34daaf781f0b7dd23c71ae3bb6def706815d2f0 (diff)
downloaddotemacs-6a418bc6beb60f36d2655ba3d3e98e1033f16cb7.tar.gz
dotemacs-6a418bc6beb60f36d2655ba3d3e98e1033f16cb7.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--backend-registry.el')
0 files changed, 0 insertions, 0 deletions