MCPcopy
hub / github.com/labstack/echo / TestStartConfig_WithBeforeServeFunc

Function TestStartConfig_WithBeforeServeFunc

server_test.go:602–617  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

600}
601
602func TestStartConfig_WithBeforeServeFunc(t *testing.T) {
603 e := New()
604
605 e.GET("/ok", func(c *Context) error {
606 return c.String(http.StatusOK, "OK")
607 })
608
609 s := &StartConfig{
610 Address: ":0",
611 BeforeServeFunc: func(s *http.Server) error {
612 return errors.New("is called before serve")
613 },
614 }
615 err := s.Start(stdContext.Background(), e)
616 assert.EqualError(t, err, "is called before serve")
617}
618
619func TestStartConfig_WithHTTP2WithCustomTlsConfig(t *testing.T) {
620 var testCases = []struct {

Callers

nothing calls this directly

Calls 4

StartMethod · 0.95
NewFunction · 0.85
GETMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…