MCPcopy
hub / github.com/yusing/godoxy / TestFindRouteByDomains

Function TestFindRouteByDomains

internal/entrypoint/entrypoint_test.go:114–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestFindRouteByDomains(t *testing.T) {
115 ep := NewTestEntrypoint(t, nil)
116 ep.SetFindRouteDomains([]string{
117 ".domain.com",
118 ".sub.domain.com",
119 })
120
121 addRoute(t, "app1")
122
123 tests := []string{
124 "app1.domain.com",
125 "app1.sub.domain.com",
126 }
127 testsNoMatch := []string{
128 "sub.app1.com",
129 "app1.com",
130 "app1.domain.co",
131 "app1.domain.com.hk",
132 "app1.sub.domain.co",
133 "app2.domain.com",
134 "app2.sub.domain.com",
135 }
136
137 run(t, ep, tests, testsNoMatch)
138}
139
140func TestFindRouteByDomainsExactMatch(t *testing.T) {
141 ep := NewTestEntrypoint(t, nil)

Callers

nothing calls this directly

Calls 4

NewTestEntrypointFunction · 0.85
addRouteFunction · 0.85
SetFindRouteDomainsMethod · 0.80
runFunction · 0.70

Tested by

no test coverage detected