mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-30 10:35:32 +02:00
kvdb/test: fix cursor tests to match bbolt semantics
From bbolt docs: // Seek positions the cursor at the passed seek key. If the key does not exist, // the cursor is moved to the next key after seek. Returns the new pair.
This commit is contained in:
@ -99,8 +99,8 @@ func testReadCursorNonEmptyInterval(t *testing.T, db walletdb.DB) {
|
||||
|
||||
// Seek to nonexisting key.
|
||||
k, v = cursor.Seek(nil)
|
||||
require.Nil(t, k)
|
||||
require.Nil(t, v)
|
||||
require.Equal(t, "b", string(k))
|
||||
require.Equal(t, "1", string(v))
|
||||
|
||||
k, v = cursor.Seek([]byte("x"))
|
||||
require.Nil(t, k)
|
||||
@ -113,7 +113,6 @@ func testReadCursorNonEmptyInterval(t *testing.T, db walletdb.DB) {
|
||||
}
|
||||
|
||||
func testReadWriteCursor(t *testing.T, db walletdb.DB) {
|
||||
|
||||
testKeyValues := []KV{
|
||||
{"b", "1"},
|
||||
{"c", "2"},
|
||||
|
Reference in New Issue
Block a user