MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestWal_Read

Function TestWal_Read

lib/wal/wal_test.go:34–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestWal_Read(t *testing.T) {
35 wal, err := New()
36 assert.Nil(t, err)
37
38 data := []byte("test data")
39 err = wal.Write(data)
40 assert.Nil(t, err)
41
42 index, err := wal.log.LastIndex()
43
44 readData, err := wal.Read(index)
45 assert.Nil(t, err)
46 assert.Equal(t, data, readData)
47}
48
49func TestWal_ReadLast(t *testing.T) {
50 wal, err := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
WriteMethod · 0.65
ReadMethod · 0.65
LastIndexMethod · 0.45

Tested by

no test coverage detected