INNER CODE UNIT · Go

TestChainID

opencontainers/image-spec · identity/chainid_test.go:25

func TestChainID(t *testing.T) {
	// To provide a good testing base, we define the individual links in a
	// chain recursively, illustrating the calculations for each chain.
	//
	// Note that we use invalid digests for the unmodified identifiers here to
	// make the computation more readable.
	chainDigestAB := digest.FromString("sha256:a" + " " + "sha256:b")              // chain for A|B
	chainDigestABC := digest.FromString(chainDigestAB.String() + " " + "sha256:c") // chain for A|B|C

	for _, testcase := range []struct {
		Name     string
		Digests  []digest.Digest
		Expected []digest.Digest
	}{
		{
			Name: "nil",
		},
		{

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…