MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / TestParseUnifiedDiff_NoCountHunk

Function TestParseUnifiedDiff_NoCountHunk

vcs/git/git_diff_lines_test.go:59–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestParseUnifiedDiff_NoCountHunk(t *testing.T) {
60 // `@@ -5 +7 @@` (count omitted on both sides → 1 line each)
61 raw := strings.Join([]string{
62 "diff --git a/f b/f",
63 "--- a/f",
64 "+++ b/f",
65 "@@ -5 +7 @@",
66 "-old line",
67 "+new line",
68 "",
69 }, "\n")
70 got := parseUnifiedDiff(raw)
71 fd := got["f"]
72 assert.Equal(t, []int{5}, fd.Deletions)
73 assert.Equal(t, []int{7}, fd.Additions)
74}
75
76func TestParseUnifiedDiff_NewFile(t *testing.T) {
77 raw := strings.Join([]string{

Callers

nothing calls this directly

Calls 1

parseUnifiedDiffFunction · 0.85

Tested by

no test coverage detected