(t *testing.T)
| 263 | } |
| 264 | |
| 265 | func TestParseReferenceWithTagAndDigest(t *testing.T) { |
| 266 | shortRef := "busybox:latest@sha256:86e0e091d0da6bde2456dbb48306f3956bbeb2eae1b5b9a43045843f69fe4aaa" |
| 267 | ref, err := ParseNormalizedNamed(shortRef) |
| 268 | if err != nil { |
| 269 | t.Fatal(err) |
| 270 | } |
| 271 | if expected, actual := "docker.io/library/"+shortRef, ref.String(); actual != expected { |
| 272 | t.Fatalf("Invalid parsed reference for %q: expected %q, got %q", ref, expected, actual) |
| 273 | } |
| 274 | |
| 275 | if _, isTagged := ref.(NamedTagged); !isTagged { |
| 276 | t.Fatalf("Reference from %q should support tag", ref) |
| 277 | } |
| 278 | if _, isCanonical := ref.(Canonical); !isCanonical { |
| 279 | t.Fatalf("Reference from %q should support digest", ref) |
| 280 | } |
| 281 | if expected, actual := shortRef, FamiliarString(ref); actual != expected { |
| 282 | t.Fatalf("Invalid parsed reference for %q: expected %q, got %q", ref, expected, actual) |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | func TestInvalidReferenceComponents(t *testing.T) { |
| 287 | if _, err := ParseNormalizedNamed("-foo"); err == nil { |
nothing calls this directly
no test coverage detected
searching dependent graphs…