(t *testing.T)
| 553 | } |
| 554 | |
| 555 | func TestBuildFileMetadataTable(t *testing.T) { |
| 556 | diffs := []model.Diff{ |
| 557 | {NewPath: "a.go", IsNew: true, Insertions: 10}, |
| 558 | {NewPath: "b.go", IsDeleted: true, Deletions: 5}, |
| 559 | {NewPath: "c.go", OldPath: "old_c.go", IsRenamed: true, Insertions: 2, Deletions: 1}, |
| 560 | {NewPath: "d.go", OldPath: "d.go", Insertions: 3, Deletions: 4}, |
| 561 | } |
| 562 | // The grouping file list shares formatDiffEntry with the other-changed-files |
| 563 | // block, so both prompts enumerate files the same way. buildFileList adds a |
| 564 | // zero-based index prefix on top, which the model groups by. Pin the exact |
| 565 | // shape, including the per-entry trailing newline the grouping template |
| 566 | // relies on. |
| 567 | want := "[0] ADDED a.go (+10/-0)\n" + |
| 568 | "[1] DELETED b.go (+0/-5)\n" + |
| 569 | "[2] RENAMED c.go (+2/-1)\n" + |
| 570 | "[3] MODIFIED d.go (+3/-4)\n" |
| 571 | if got := buildFileList(diffs); got != want { |
| 572 | t.Errorf("got %q, want %q", got, want) |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | func TestResolveGroupSystemRule(t *testing.T) { |
| 577 | const ( |
nothing calls this directly
no test coverage detected