diff --git a/mvcc/kvstore_test.go b/mvcc/kvstore_test.go index 72c2ca9cb..195429417 100644 --- a/mvcc/kvstore_test.go +++ b/mvcc/kvstore_test.go @@ -405,9 +405,14 @@ func TestStoreRestore(t *testing.T) { if g := b.tx.Action(); !reflect.DeepEqual(g, wact) { t.Errorf("tx actions = %+v, want %+v", g, wact) } + + gens := []generation{ + {created: revision{4, 0}, ver: 2, revs: []revision{{3, 0}, {5, 0}}}, + {created: revision{0, 0}, ver: 0, revs: nil}, + } + ki := &keyIndex{key: []byte("foo"), modified: revision{5, 0}, generations: gens} wact = []testutil.Action{ - {"restore", []interface{}{[]byte("foo"), revision{4, 0}, revision{3, 0}, int64(1)}}, - {"tombstone", []interface{}{[]byte("foo"), revision{5, 0}}}, + {"insert", []interface{}{ki}}, } if g := fi.Action(); !reflect.DeepEqual(g, wact) { t.Errorf("index action = %+v, want %+v", g, wact) @@ -668,6 +673,10 @@ func (i *fakeIndex) Compact(rev int64) map[revision]struct{} { } func (i *fakeIndex) Equal(b index) bool { return false } +func (i *fakeIndex) Insert(ki *keyIndex) { + i.Recorder.Record(testutil.Action{Name: "insert", Params: []interface{}{ki}}) +} + func createBytesSlice(bytesN, sliceN int) [][]byte { rs := [][]byte{} for len(rs) != sliceN {