MCPcopy Index your code
hub / github.com/docker/docker-agent / TestIsDigestReference

Function TestIsDigestReference

pkg/remote/pull_test.go:516–537  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

514}
515
516func TestIsDigestReference(t *testing.T) {
517 t.Parallel()
518
519 tests := []struct {
520 name string
521 ref string
522 expected bool
523 }{
524 {"tag reference", "agentcatalog/review-pr:latest", false},
525 {"implicit tag", "agentcatalog/review-pr", false},
526 {"digest reference", "agentcatalog/review-pr@sha256:0000000000000000000000000000000000000000000000000000000000000000", true},
527 {"fully qualified digest", "index.docker.io/agentcatalog/review-pr@sha256:0000000000000000000000000000000000000000000000000000000000000000", true},
528 {"invalid reference", ":::invalid", false},
529 }
530
531 for _, tt := range tests {
532 t.Run(tt.name, func(t *testing.T) {
533 t.Parallel()
534 assert.Equal(t, tt.expected, IsDigestReference(tt.ref))
535 })
536 }
537}
538
539func TestSeparator(t *testing.T) {
540 t.Parallel()

Callers

nothing calls this directly

Calls 2

IsDigestReferenceFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected