MCPcopy Create free account
hub / github.com/abemedia/go-don / TestError_StatusCode

Function TestError_StatusCode

errors_test.go:35–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestError_StatusCode(t *testing.T) {
36 if don.Error(don.ErrBadRequest, 0).StatusCode() != fasthttp.StatusBadRequest {
37 t.Error("should respect wrapped error's status code")
38 }
39 if don.Error(don.ErrBadRequest, fasthttp.StatusConflict).StatusCode() != fasthttp.StatusConflict {
40 t.Error("should ignore wrapped error's status code if explicitly set")
41 }
42}
43
44func TestError_MarshalText(t *testing.T) {
45 b, _ := don.Error(errTest, 0).MarshalText()

Callers

nothing calls this directly

Calls 2

StatusCodeMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected