(t *testing.T)
| 514 | } |
| 515 | |
| 516 | func 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 | |
| 539 | func TestSeparator(t *testing.T) { |
| 540 | t.Parallel() |
nothing calls this directly
no test coverage detected