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

Function testConnSeekLastOffset

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

Source from the content-addressed store, hash-verified

417}
418
419func testConnSeekLastOffset(t *testing.T, conn *Conn) {
420 for i := 0; i != 10; i++ {
421 if _, err := conn.Write([]byte(strconv.Itoa(i))); err != nil {
422 t.Fatal(err)
423 }
424 }
425
426 offset, err := conn.Seek(0, SeekEnd)
427 if err != nil {
428 t.Error(err)
429 }
430
431 if offset != 10 {
432 t.Error("bad offset:", offset)
433 }
434}
435
436func testConnSeekCurrentOffset(t *testing.T, conn *Conn) {
437 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