test

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WaitDuration  = 4 * time.Second
	WaitShortTick = 50 * time.Millisecond
	WaitTick      = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

func DoHash added in v1.0.0

func DoHash(t *testing.T, data Hashable) []byte

func RandomBytes

func RandomBytes(len int) []byte

func RandomString added in v0.2.0

func RandomString(len int) string

func RandomUint32 added in v1.0.0

func RandomUint32() uint32

func TryTilCountIs added in v1.0.0

func TryTilCountIs(t *testing.T, condition func() bool, cnt uint64, tick time.Duration, msgAndArgs ...interface{})

TryTilCountIs - checks condition after each tick until condition returns true or count is equal to cnt in which case the test fails. Prefer this helper to require.Evetually when test timeout is small or close to tick timeout.

Types

type Hashable added in v1.0.0

type Hashable interface {
	Hash(hashAlgorithm crypto.Hash) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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