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

Function testConnSeekRandomOffset

conn_test.go:462–477  ·  view source on GitHub ↗
(t *testing.T, conn *Conn)

Source from the content-addressed store, hash-verified

460}
461
462func testConnSeekRandomOffset(t *testing.T, conn *Conn) {
463 for i := 0; i != 10; i++ {
464 if _, err := conn.Write([]byte(strconv.Itoa(i))); err != nil {
465 t.Fatal(err)
466 }
467 }
468
469 offset, err := conn.Seek(3, SeekAbsolute)
470 if err != nil {
471 t.Error(err)
472 }
473
474 if offset != 3 {
475 t.Error("bad offset:", offset)
476 }
477}
478
479func testConnSeekDontCheck(t *testing.T, conn *Conn) {
480 for i := 0; i != 10; i++ {

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.45
SeekMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected