MCPcopy Create free account
hub / github.com/conforma/cli / TestBuildPolicyDiffDisplay_Integration

Function TestBuildPolicyDiffDisplay_Integration

cmd/validate/vsa_test.go:2664–2685  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2662}
2663
2664func 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}

Callers

nothing calls this directly

Calls 2

buildPolicyDiffDisplayFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected