Documentation
¶
Overview ¶
Package golden compares produced bytes against frozen fixtures.
DevProof's format bytes are a compatibility surface (DP-015): canonical tree records, config JSON, tar headers, gzip output, and OCI manifest JSON must not change for a released format version, whatever a refactor or a dependency upgrade does. This package is the mechanism that makes such a change fail a test instead of silently reissuing every subject digest under a new identity.
Fixtures live under testdata/format/<version>/. Regenerating them is correct only when introducing a new format version, never when an existing one "looks wrong".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert compares got against the fixture at path, failing the test on any difference.
path is interpreted relative to the calling package's directory, so a test in internal/canonical passes "testdata/format/v1/tree-records.bin".
func AssertString ¶
AssertString is Assert for text fixtures, reporting a line-oriented difference rather than a hex dump.
Types ¶
type TB ¶
TB is the slice of *testing.T this package needs.
It is a local interface rather than testing.TB because testing.TB cannot be implemented outside the testing package, which would leave this package's own failure reporting untestable — and a golden-byte checker that reports "match" when it should report "mismatch" is worse than no checker.