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

Function TestDomainRegexp

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

Source from the content-addressed store, hash-verified

38}
39
40func TestDomainRegexp(t *testing.T) {
41 hostcases := []regexpMatch{
42 {
43 input: "test.com",
44 match: true,
45 },
46 {
47 input: "test.com:10304",
48 match: true,
49 },
50 {
51 input: "test.com:http",
52 match: false,
53 },
54 {
55 input: "localhost",
56 match: true,
57 },
58 {
59 input: "localhost:8080",
60 match: true,
61 },
62 {
63 input: "a",
64 match: true,
65 },
66 {
67 input: "a.b",
68 match: true,
69 },
70 {
71 input: "ab.cd.com",
72 match: true,
73 },
74 {
75 input: "a-b.com",
76 match: true,
77 },
78 {
79 input: "-ab.com",
80 match: false,
81 },
82 {
83 input: "ab-.com",
84 match: false,
85 },
86 {
87 input: "ab.c-om",
88 match: true,
89 },
90 {
91 input: "ab.-com",
92 match: false,
93 },
94 {
95 input: "ab.com-",
96 match: false,
97 },

Callers

nothing calls this directly

Calls 2

checkRegexpFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…