MCPcopy
hub / github.com/segmentio/kafka-go / TestLeaveGroupResponseV0

Function TestLeaveGroupResponseV0

leavegroup_test.go:193–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func TestLeaveGroupResponseV0(t *testing.T) {
194 item := leaveGroupResponseV0{
195 ErrorCode: 2,
196 }
197
198 b := bytes.NewBuffer(nil)
199 w := &writeBuffer{w: b}
200 item.writeTo(w)
201
202 var found leaveGroupResponseV0
203 remain, err := (&found).readFrom(bufio.NewReader(b), b.Len())
204 if err != nil {
205 t.Error(err)
206 t.FailNow()
207 }
208 if remain != 0 {
209 t.Errorf("expected 0 remain, got %v", remain)
210 t.FailNow()
211 }
212 if !reflect.DeepEqual(item, found) {
213 t.Error("expected item and found to be the same")
214 t.FailNow()
215 }
216}

Callers

nothing calls this directly

Calls 5

writeToMethod · 0.95
NewReaderMethod · 0.65
LenMethod · 0.65
readFromMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected