MCPcopy
hub / github.com/tinylib/msgp / TestCause

Function TestCause

msgp/errors_test.go:63–79  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61}
62
63func TestCause(t *testing.T) {
64 for idx, err := range []error{
65 errors.New("test"),
66 ArrayError{},
67 &ErrUnsupportedType{},
68 } {
69 t.Run(fmt.Sprintf("%d", idx), func(t *testing.T) {
70 cerr := WrapError(err, "test")
71 if cerr == err {
72 t.Fatal()
73 }
74 if Cause(err) != err {
75 t.Fatal()
76 }
77 })
78 }
79}
80
81func TestCauseShortByte(t *testing.T) {
82 err := ErrShortBytes

Callers

nothing calls this directly

Calls 2

WrapErrorFunction · 0.85
CauseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…