MCPcopy Index your code
hub / github.com/tinylib/msgp / TestErrorCtxAsMapDecode

Function TestErrorCtxAsMapDecode

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

Source from the content-addressed store, hash-verified

131}
132
133func TestErrorCtxAsMapDecode(t *testing.T) {
134 bts := marshalErrorCtx(fillErrorCtxAsMap())
135 cnt := countStrings(bts)
136
137 var as []string
138 for i := 0; i < cnt; i++ {
139 dodgeBts := dodgifyMsgpString(bts, i)
140
141 r := msgp.NewReader(bytes.NewReader(dodgeBts))
142 var ec ErrorCtxAsMap
143 err := (&ec).DecodeMsg(r)
144 as = append(as, err.Error())
145 }
146
147 ok, a, b := diffstrs(as, expectedAsMap())
148 if !ok {
149 t.Fatal(a, b)
150 }
151}
152
153func TestErrorCtxAsTupleUnmarshal(t *testing.T) {
154 bts := marshalErrorCtx(fillErrorCtxAsTuple())

Callers

nothing calls this directly

Calls 9

NewReaderFunction · 0.92
marshalErrorCtxFunction · 0.85
fillErrorCtxAsMapFunction · 0.85
countStringsFunction · 0.85
dodgifyMsgpStringFunction · 0.85
diffstrsFunction · 0.85
expectedAsMapFunction · 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…