MCPcopy
hub / github.com/dgraph-io/badger / checkKeys

Function checkKeys

value_test.go:812–823  ·  view source on GitHub ↗
(t *testing.T, kv *DB, keys [][]byte)

Source from the content-addressed store, hash-verified

810}
811
812func checkKeys(t *testing.T, kv *DB, keys [][]byte) {
813 i := 0
814 txn := kv.NewTransaction(false)
815 defer txn.Discard()
816 iter := txn.NewIterator(IteratorOptions{})
817 defer iter.Close()
818 for iter.Seek(keys[0]); iter.Valid(); iter.Next() {
819 require.Equal(t, iter.Item().Key(), keys[i])
820 i++
821 }
822 require.Equal(t, i, len(keys))
823}
824
825type testHelper struct {
826 db *DB

Callers 2

TestL0GCBugFunction · 0.85

Calls 9

CloseMethod · 0.95
SeekMethod · 0.95
ValidMethod · 0.95
NextMethod · 0.95
ItemMethod · 0.95
NewTransactionMethod · 0.80
DiscardMethod · 0.80
KeyMethod · 0.65
NewIteratorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…