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

Function TestParseRepositoryInfo

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

Source from the content-addressed store, hash-verified

125}
126
127func TestParseRepositoryInfo(t *testing.T) {
128 type tcase struct {
129 RemoteName, FamiliarName, FullName, AmbiguousName, Domain string
130 }
131
132 tcases := []tcase{
133 {
134 RemoteName: "fooo/bar",
135 FamiliarName: "fooo/bar",
136 FullName: "docker.io/fooo/bar",
137 AmbiguousName: "index.docker.io/fooo/bar",
138 Domain: "docker.io",
139 },
140 {
141 RemoteName: "library/ubuntu",
142 FamiliarName: "ubuntu",
143 FullName: "docker.io/library/ubuntu",
144 AmbiguousName: "library/ubuntu",
145 Domain: "docker.io",
146 },
147 {
148 RemoteName: "nonlibrary/ubuntu",
149 FamiliarName: "nonlibrary/ubuntu",
150 FullName: "docker.io/nonlibrary/ubuntu",
151 AmbiguousName: "",
152 Domain: "docker.io",
153 },
154 {
155 RemoteName: "other/library",
156 FamiliarName: "other/library",
157 FullName: "docker.io/other/library",
158 AmbiguousName: "",
159 Domain: "docker.io",
160 },
161 {
162 RemoteName: "private/moonbase",
163 FamiliarName: "127.0.0.1:8000/private/moonbase",
164 FullName: "127.0.0.1:8000/private/moonbase",
165 AmbiguousName: "",
166 Domain: "127.0.0.1:8000",
167 },
168 {
169 RemoteName: "privatebase",
170 FamiliarName: "127.0.0.1:8000/privatebase",
171 FullName: "127.0.0.1:8000/privatebase",
172 AmbiguousName: "",
173 Domain: "127.0.0.1:8000",
174 },
175 {
176 RemoteName: "private/moonbase",
177 FamiliarName: "example.com/private/moonbase",
178 FullName: "example.com/private/moonbase",
179 AmbiguousName: "",
180 Domain: "example.com",
181 },
182 {
183 RemoteName: "privatebase",
184 FamiliarName: "example.com/privatebase",

Callers

nothing calls this directly

Calls 5

ParseNormalizedNamedFunction · 0.85
FamiliarNameFunction · 0.85
DomainFunction · 0.85
PathFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…