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

Function makeTestSequence

reader_test.go:492–502  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

490}
491
492func makeTestSequence(n int) []Message {
493 base := time.Now()
494 msgs := make([]Message, n)
495 for i := 0; i != n; i++ {
496 msgs[i] = Message{
497 Time: base.Add(time.Duration(i) * time.Millisecond).Truncate(time.Millisecond),
498 Value: []byte(strconv.Itoa(i)),
499 }
500 }
501 return msgs
502}
503
504func prepareReader(t *testing.T, ctx context.Context, r *Reader, msgs ...Message) {
505 config := r.Config()

Calls 1

TruncateMethod · 0.45

Tested by

no test coverage detected