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

Function testConnSeekDontCheck

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

Source from the content-addressed store, hash-verified

477}
478
479func testConnSeekDontCheck(t *testing.T, conn *Conn) {
480 for i := 0; i != 10; i++ {
481 if _, err := conn.Write([]byte(strconv.Itoa(i))); err != nil {
482 t.Fatal(err)
483 }
484 }
485
486 offset, err := conn.Seek(42, SeekAbsolute|SeekDontCheck)
487 if err != nil {
488 t.Error(err)
489 }
490
491 if offset != 42 {
492 t.Error("bad offset:", offset)
493 }
494
495 if _, err := conn.ReadMessage(1024); !errors.Is(err, OffsetOutOfRange) {
496 t.Error("unexpected error:", err)
497 }
498}
499
500func testConnWriteReadSequentially(t *testing.T, conn *Conn) {
501 for i := 0; i != 10; i++ {

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.45
SeekMethod · 0.45
ErrorMethod · 0.45
ReadMessageMethod · 0.45

Tested by

no test coverage detected