Update evidence context output coverage

This commit is contained in:
2026-08-09 19:45:21 +00:00
parent 071a78ae22
commit 449b506804
4 changed files with 35 additions and 45 deletions

View File

@@ -353,8 +353,8 @@ func TestEncodeIncludesValidatedEvidenceContext(t *testing.T) {
if err != nil {
t.Fatalf("Decode(evidence context file) error = %v", err)
}
if len(value.Contexts) != 0 {
t.Fatalf("evidence context = %#v, want explicit empty contexts", value)
if len(value) != 1 || value[0].ID != 7 || value[0].Text != "Source content retained only in the evidence artifact." {
t.Fatalf("evidence context = %#v, want the published source-unit array", value)
}
index := decodeObject(t, fileBytes(t, result.Files, "index.json"))
if got, want := index["evidence_context"], map[string]any{
@@ -786,7 +786,8 @@ func acceptedEvidenceContextArtifact(t *testing.T) contracts.SerializedArtifact
}
document.Digest = digest
artifact, err := evidencecontext.Serialize(evidencecontext.BuildRequest{
Source: document, WindowUnits: 3, SelectedLanes: []string{"spells"},
Source: document, WindowUnits: 3,
SourceRefs: []source.SourceRef{{SourceID: "source-1", StartUnitID: 7, EndUnitID: 7}},
})
if err != nil {
t.Fatal(err)