MCPcopy Create free account
hub / github.com/docker/cli / TestMatchReleasedSignaturesSortOrder

Function TestMatchReleasedSignaturesSortOrder

cmd/docker-trust/trust/common_test.go:13–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestMatchReleasedSignaturesSortOrder(t *testing.T) {
14 releasesRole := data.DelegationRole{BaseRole: data.BaseRole{Name: trust.ReleasesRole}}
15 targets := []client.TargetSignedStruct{
16 {Target: client.Target{Name: "target10-foo"}, Role: releasesRole},
17 {Target: client.Target{Name: "target1-foo"}, Role: releasesRole},
18 {Target: client.Target{Name: "target2-foo"}, Role: releasesRole},
19 }
20
21 rows := matchReleasedSignatures(targets)
22
23 targetNames := make([]string, 0, len(rows))
24 for _, r := range rows {
25 targetNames = append(targetNames, r.SignedTag)
26 }
27 expected := []string{
28 "target1-foo",
29 "target2-foo",
30 "target10-foo",
31 }
32 assert.Check(t, is.DeepEqual(expected, targetNames))
33}

Callers

nothing calls this directly

Calls 1

matchReleasedSignaturesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…