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

Function run

internal/entrypoint/entrypoint_test.go:46–70  ·  view source on GitHub ↗
(t *testing.T, ep *Entrypoint, match []string, noMatch []string)

Source from the content-addressed store, hash-verified

44}
45
46func run(t *testing.T, ep *Entrypoint, match []string, noMatch []string) {
47 t.Helper()
48
49 server, ok := ep.GetServer(":" + strconv.Itoa(testHTTPRouteListenPort))
50 require.True(t, ok, "server not found")
51 require.NotNil(t, server)
52
53 for _, test := range match {
54 t.Run(test, func(t *testing.T) {
55 route := server.FindRoute(test)
56 assert.NotNil(t, route)
57 })
58 }
59
60 for _, test := range noMatch {
61 t.Run(test, func(t *testing.T) {
62 route := server.FindRoute(test)
63 assert.Nil(t, route)
64
65 found, ok := ep.HTTPRoutes().Get(test)
66 assert.False(t, ok)
67 assert.Nil(t, found)
68 })
69 }
70}
71
72func TestFindRouteAnyDomain(t *testing.T) {
73 ep := NewTestEntrypoint(t, nil)

Callers 6

TestFindRouteAnyDomainFunction · 0.70
TestFindRouteByDomainsFunction · 0.70
TestFindRouteWithPortFunction · 0.70

Calls 4

GetServerMethod · 0.80
FindRouteMethod · 0.65
GetMethod · 0.65
HTTPRoutesMethod · 0.65

Tested by

no test coverage detected