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

Function TestErrorCtxAsTupleDecode

_generated/errorwrap_test.go:172–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

170}
171
172func TestErrorCtxAsTupleDecode(t *testing.T) {
173 bts := marshalErrorCtx(fillErrorCtxAsTuple())
174 cnt := countStrings(bts)
175
176 var as []string
177 for i := 0; i < cnt; i++ {
178 dodgeBts := dodgifyMsgpString(bts, i)
179
180 r := msgp.NewReader(bytes.NewReader(dodgeBts))
181 var ec ErrorCtxAsTuple
182 err := (&ec).DecodeMsg(r)
183 as = append(as, err.Error())
184 }
185
186 ok, a, b := diffstrs(as, expectedAsTuple())
187 if !ok {
188 t.Fatal(a, b)
189 }
190}
191
192func diffstrs(a, b []string) (ok bool, as, bs []string) {
193 ma := map[string]bool{}

Callers

nothing calls this directly

Calls 9

NewReaderFunction · 0.92
marshalErrorCtxFunction · 0.85
fillErrorCtxAsTupleFunction · 0.85
countStringsFunction · 0.85
dodgifyMsgpStringFunction · 0.85
diffstrsFunction · 0.85
expectedAsTupleFunction · 0.85
DecodeMsgMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…