(t *testing.T)
| 320 | } |
| 321 | |
| 322 | func 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 | |
| 344 | func TestParseDiff_SkipsHeaders(t *testing.T) { |
| 345 | t.Parallel() |
nothing calls this directly
no test coverage detected