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

Function TestHTTPError_StatusCode

httperror_test.go:15–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestHTTPError_StatusCode(t *testing.T) {
16 var err error = &HTTPError{Code: http.StatusBadRequest, Message: "my error message"}
17
18 code := 0
19 var sc HTTPStatusCoder
20 if errors.As(err, &sc) {
21 code = sc.StatusCode()
22 }
23 assert.Equal(t, http.StatusBadRequest, code)
24}
25
26func TestHTTPError_Error(t *testing.T) {
27 var testCases = []struct {

Callers

nothing calls this directly

Calls 1

StatusCodeMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…