MCPcopy
hub / github.com/google/go-containerregistry / TestRename

Function TestRename

pkg/gcrane/copy_test.go:274–289  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

272}
273
274func TestRename(t *testing.T) {
275 c := copier{
276 srcRepo: name.MustParseReference("registry.example.com/foo").Context(),
277 dstRepo: name.MustParseReference("registry.example.com/bar").Context(),
278 }
279
280 got, err := c.rename(name.MustParseReference("registry.example.com/foo/sub/repo").Context())
281 if err != nil {
282 t.Fatalf("unexpected err: %v", err)
283 }
284 want := name.MustParseReference("registry.example.com/bar/sub/repo").Context()
285
286 if want.String() != got.String() {
287 t.Errorf("%s != %s", want, got)
288 }
289}
290
291func TestSubtractStringLists(t *testing.T) {
292 cases := []struct {

Callers

nothing calls this directly

Calls 4

renameMethod · 0.95
MustParseReferenceFunction · 0.92
ContextMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…