(t *testing.T)
| 2662 | } |
| 2663 | |
| 2664 | func TestBuildPolicyDiffDisplay_Integration(t *testing.T) { |
| 2665 | // Test end-to-end: build from AllSectionsData and format with String() |
| 2666 | data := AllSectionsData{ |
| 2667 | HasPolicyDiff: true, |
| 2668 | AffectedImages: []string{"abc12345"}, |
| 2669 | PolicyDiffCounts: map[string]PolicyDiffCounts{ |
| 2670 | "abc12345": {Added: 2, Removed: 1, Changed: 0}, |
| 2671 | }, |
| 2672 | } |
| 2673 | |
| 2674 | diff := buildPolicyDiffDisplay(data) |
| 2675 | assert.NotNil(t, diff) |
| 2676 | output := diff.String() |
| 2677 | |
| 2678 | expected := `Policy Diff (summary) |
| 2679 | Affected images: [abc12345] |
| 2680 | Added: [include] 2 |
| 2681 | Removed: 1 |
| 2682 | Changed: none |
| 2683 | ` |
| 2684 | assert.Equal(t, expected, output) |
| 2685 | } |
nothing calls this directly
no test coverage detected