MCPcopy Create free account
hub / github.com/JanSmrcka/differ / TestParseDiff_MultipleHunks

Function TestParseDiff_MultipleHunks

internal/ui/diff_test.go:322–342  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

320}
321
322func TestParseDiff_MultipleHunks(t *testing.T) {
323 t.Parallel()
324 raw := `@@ -1,3 +1,3 @@
325 ctx1
326-old1
327+new1
328@@ -10,3 +10,3 @@
329 ctx2
330-old2
331+new2`
332 parsed := ParseDiff(raw)
333 hunks := 0
334 for _, l := range parsed.Lines {
335 if l.Type == LineHunkHeader {
336 hunks++
337 }
338 }
339 if hunks != 2 {
340 t.Errorf("expected 2 hunks, got %d", hunks)
341 }
342}
343
344func TestParseDiff_SkipsHeaders(t *testing.T) {
345 t.Parallel()

Callers

nothing calls this directly

Calls 1

ParseDiffFunction · 0.85

Tested by

no test coverage detected