testutil

package
v1.0.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2023 License: Apache-2.0, BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadgerDB

func BadgerDB(t *testing.T) (kvstore.KVStore, error)

BadgerDB creates a temporary BadgerKVStore that automatically gets cleaned up when the test finishes.

func PebbleDB

func PebbleDB(t *testing.T) (kvstore.KVStore, error)

PebbleDB creates a temporary PebbleKVStore that automatically gets cleaned up when the test finishes.

func Rand32ByteArray

func Rand32ByteArray() [32]byte

Rand32ByteArray returns an array with 32 random bytes.

func Rand49ByteArray

func Rand49ByteArray() [49]byte

Rand49ByteArray returns an array with 49 random bytes.

func Rand64ByteArray

func Rand64ByteArray() [64]byte

Rand64ByteArray returns an array with 64 random bytes.

func RandByte

func RandByte() byte

RandByte returns a random byte.

func RandBytes

func RandBytes(length int) []byte

RandBytes returns length amount random bytes.

func RandFloat64

func RandFloat64(max float64) float64

RandFloat64 returns a random float64.

func RandString

func RandString(length int) string

func RandUint16

func RandUint16(max uint16) uint16

RandUint16 returns a random uint16.

func RandUint32

func RandUint32(max uint32) uint32

RandUint32 returns a random uint32.

func RandUint64

func RandUint64(max uint64) uint64

RandUint64 returns a random uint64.

func RandUint8

func RandUint8(max uint8) uint8

RandUint8 returns a random uint8.

func RandomFloat64

func RandomFloat64() float64

func RandomInt31n

func RandomInt31n(n int32) int32

func RandomInt63n

func RandomInt63n(n int64) int64

func RandomIntn

func RandomIntn(n int) int

func RandomRead

func RandomRead(p []byte) (n int, err error)

func RocksDB

func RocksDB(t *testing.T) (kvstore.KVStore, error)

RocksDB creates a temporary RocksDBKVStore that automatically gets cleaned up when the test finishes.

func SortedRand32BytArray

func SortedRand32BytArray(count int) [][32]byte

SortedRand32BytArray returns a count length slice of sorted 32 byte arrays.

func TempDir

func TempDir(t *testing.T) (string, error)

TempDir creates a temporary directory, that automatically gets cleaned up when the test finishes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL