Issue 1585, S19: the strict parser, every manifest problem function and the judge's tables (192 declarations, about 5,200 lines) and their 244 tests leave; composition keeps its own refusals and the helpers it uses. The catalogue's tests decode the manifests they build. ParseManifest, ParseManifestWith, ParseManifestForInputs, CatalogueProblems and the rest are gone; mesh-delivery-indexer/judge holds them. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
28 lines
948 B
Go
28 lines
948 B
Go
package catalogue
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// An archive pinned by URL and sha256 (novox/hq ADR 0316 §2, §6): the vendor's file, mirrored by the build
|
|
// seat, never a copy in the repository.
|
|
|
|
const pinnedSum = "38dd24890a66b4cf9a45bc24e15192e00c26b929e1bb8df7974c16a4539129e2"
|
|
|
|
func upstreamManifest(artifact string) string {
|
|
return `{"module":"a","version":"1","build":{"artifacts":[` + artifact + `]}}`
|
|
}
|
|
|
|
func TestAnArchivePinnedByURLAndSha256IsAccepted(t *testing.T) {
|
|
for _, a := range []string{
|
|
`{"name":"archive","kind":"archive","url":"https://vendor.example.org/release-1.tar.xz","sha256":"` + pinnedSum +
|
|
`","version":"1.0","within":"release"}`,
|
|
`{"name":"addon","kind":"archive","url":"https://vendor.example.org/addon.xpi","sha256":"` + pinnedSum +
|
|
`","version":"1.5.6.1","file":"addon.xpi"}`,
|
|
} {
|
|
if _, err := decodeForTest([]byte(upstreamManifest(a))); err != nil {
|
|
t.Errorf("%s was refused: %v", a, err)
|
|
}
|
|
}
|
|
}
|