Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Jan 6, 2025
1 parent 5a22264 commit 77fb95b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion storage/operation/reads_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func BenchmarkIterate(t *testing.B) {

t.ResetTimer()
var found [][]byte
require.NoError(t, operation.IterateKeysInPrefixRange(prefix1, prefix2, func(key []byte) error {
require.NoError(t, operation.Iterate(prefix1, prefix2, func(key []byte) error {
found = append(found, key)
return nil
})(r), "should iterate forward without error")
Expand Down
5 changes: 3 additions & 2 deletions storage/operation/writes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/onflow/flow-go/storage"
"github.com/onflow/flow-go/storage/operation"
"github.com/onflow/flow-go/storage/operation/dbtest"
"github.com/onflow/flow-go/utils/unittest"
)

func TestReadWrite(t *testing.T) {
Expand Down Expand Up @@ -331,10 +332,10 @@ func TestRemoveByPrefix(t *testing.T) {
}

actual := make([][]byte, 0)
err = operation.Iterate([]byte{keys[0][0]}, operation.PrefixUpperBound(keys[len(keys)-1]), operation.KeyOnlyIterateFunc(func(key []byte) error {
err = operation.Iterate([]byte{keys[0][0]}, storage.PrefixUpperBound(keys[len(keys)-1]), func(key []byte) error {
actual = append(actual, key)
return nil
}), storage.DefaultIteratorOptions())(r)
})(r)
require.NoError(t, err)
require.Equal(t, expected, actual, "expected keys to match expected values")
})
Expand Down

0 comments on commit 77fb95b

Please sign in to comment.