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

Function TestNormalizedSplitHostname

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

Source from the content-addressed store, hash-verified

412}
413
414func TestNormalizedSplitHostname(t *testing.T) {
415 testcases := []struct {
416 input string
417 domain string
418 name string
419 }{
420 {
421 input: "test.com/foo",
422 domain: "test.com",
423 name: "foo",
424 },
425 {
426 input: "test_com/foo",
427 domain: "docker.io",
428 name: "test_com/foo",
429 },
430 {
431 input: "docker/migrator",
432 domain: "docker.io",
433 name: "docker/migrator",
434 },
435 {
436 input: "test.com:8080/foo",
437 domain: "test.com:8080",
438 name: "foo",
439 },
440 {
441 input: "test-com:8080/foo",
442 domain: "test-com:8080",
443 name: "foo",
444 },
445 {
446 input: "foo",
447 domain: "docker.io",
448 name: "library/foo",
449 },
450 {
451 input: "xn--n3h.com/foo",
452 domain: "xn--n3h.com",
453 name: "foo",
454 },
455 {
456 input: "xn--n3h.com:18080/foo",
457 domain: "xn--n3h.com:18080",
458 name: "foo",
459 },
460 {
461 input: "docker.io/foo",
462 domain: "docker.io",
463 name: "library/foo",
464 },
465 {
466 input: "docker.io/library/foo",
467 domain: "docker.io",
468 name: "library/foo",
469 },
470 {
471 input: "docker.io/library/foo/bar",

Callers

nothing calls this directly

Calls 2

ParseNormalizedNamedFunction · 0.85
SplitHostnameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…