MCPcopy Create free account
hub / github.com/pace/bricks / TestErrorObjectWritesExpectedErrorMessage

Function TestErrorObjectWritesExpectedErrorMessage

http/jsonapi/errors_test.go:15–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestErrorObjectWritesExpectedErrorMessage(t *testing.T) {
16 err := &ErrorObject{Title: "Title test.", Detail: "Detail test."}
17 var input error = err
18
19 output := input.Error()
20
21 if output != fmt.Sprintf("Error: %s %s\n", err.Title, err.Detail) {
22 t.Fatal("Unexpected output.")
23 }
24}
25
26func TestMarshalErrorsWritesTheExpectedPayload(t *testing.T) {
27 marshalErrorsTableTasts := []struct {

Callers

nothing calls this directly

Calls 2

FatalMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…