MCPcopy Create free account
hub / github.com/containers/image / TestInvalidReferenceComponents

Function TestInvalidReferenceComponents

docker/reference/normalize_test.go:286–300  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

284}
285
286func TestInvalidReferenceComponents(t *testing.T) {
287 if _, err := ParseNormalizedNamed("-foo"); err == nil {
288 t.Fatal("Expected WithName to detect invalid name")
289 }
290 ref, err := ParseNormalizedNamed("busybox")
291 if err != nil {
292 t.Fatal(err)
293 }
294 if _, err := WithTag(ref, "-foo"); err == nil {
295 t.Fatal("Expected WithName to detect invalid tag")
296 }
297 if _, err := WithDigest(ref, digest.Digest("foo")); err == nil {
298 t.Fatal("Expected WithDigest to detect invalid digest")
299 }
300}
301
302func equalReference(r1, r2 Reference) bool {
303 switch v1 := r1.(type) {

Callers

nothing calls this directly

Calls 4

ParseNormalizedNamedFunction · 0.85
WithTagFunction · 0.85
WithDigestFunction · 0.85
DigestMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…