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

Function TestWal_Write

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

Source from the content-addressed store, hash-verified

15}
16
17func TestWal_Write(t *testing.T) {
18 wal, err := New()
19 assert.Nil(t, err)
20 index, err := wal.log.LastIndex()
21
22 assert.Nil(t, err)
23 assert.Equal(t, uint64(1), index)
24
25 data := []byte("test data")
26 err = wal.Write(data)
27 assert.Nil(t, err)
28
29 index, err = wal.log.LastIndex()
30 assert.Nil(t, err)
31 assert.Equal(t, uint64(2), index)
32}
33
34func TestWal_Read(t *testing.T) {
35 wal, err := New()

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
WriteMethod · 0.65
LastIndexMethod · 0.45

Tested by

no test coverage detected