mirror of
https://github.com/chaisql/chai.git
synced 2025-10-05 15:46:55 +08:00
22 lines
364 B
Go
22 lines
364 B
Go
package testutil
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/cockroachdb/pebble/v2"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func DumpPebble(t testing.TB, pdb *pebble.DB) {
|
|
it, err := pdb.NewIter(nil)
|
|
require.NoError(t, err)
|
|
|
|
for it.First(); it.Valid(); it.Next() {
|
|
fmt.Printf("%v: %v\n", it.Key(), it.Value())
|
|
}
|
|
|
|
err = it.Close()
|
|
require.NoError(t, err)
|
|
}
|