MCPcopy
hub / github.com/lindb/lindb / assertReadAll

Function assertReadAll

ingestion/influx/chunk_reader_test.go:35–51  ·  view source on GitHub ↗
(t *testing.T, cr *ChunkReader)

Source from the content-addressed store, hash-verified

33a3,location=us-midwest temperature=100 1465839830100400200`
34
35func assertReadAll(t *testing.T, cr *ChunkReader) {
36 assert.True(t, cr.HasNext())
37 assert.Equal(t, "# comment", string(cr.Next()))
38 assert.Nil(t, cr.Error())
39
40 assert.True(t, cr.HasNext())
41 assert.Equal(t, "a1,location=us-midwest temperature=82 1465839830100400200", string(cr.Next()))
42
43 assert.True(t, cr.HasNext())
44 assert.Equal(t, "a2,location=us-midwest temperature=1 1465839830100400200", string(cr.Next()))
45
46 assert.True(t, cr.HasNext())
47 assert.Equal(t, "a3,location=us-midwest temperature=100 1465839830100400200", string(cr.Next()))
48
49 assert.False(t, cr.HasNext())
50 assert.NotNil(t, cr.Error())
51}
52
53func Test_ChunkReader(t *testing.T) {
54 assertReadAll(t, newChunkReader(strings.NewReader(influxText)))

Callers 2

Test_ChunkReaderFunction · 0.85
Test_ChunkReaderPoolFunction · 0.85

Calls 3

HasNextMethod · 0.65
NextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected