MCPcopy Index your code
hub / github.com/labstack/echo / TestServeWithHandler

Function TestServeWithHandler

echotest/context_test.go:13–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestServeWithHandler(t *testing.T) {
14 handler := func(c *echo.Context) error {
15 return c.String(http.StatusOK, c.QueryParam("key"))
16 }
17 testConf := ContextConfig{
18 QueryValues: url.Values{"key": []string{"value"}},
19 }
20
21 resp := testConf.ServeWithHandler(t, handler)
22
23 assert.Equal(t, http.StatusOK, resp.Code)
24 assert.Equal(t, "value", resp.Body.String())
25}
26
27func TestServeWithHandler_error(t *testing.T) {
28 handler := func(c *echo.Context) error {

Callers

nothing calls this directly

Calls 3

ServeWithHandlerMethod · 0.95
QueryParamMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…