test

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 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

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

func Eventually

func Eventually(condition func() bool, waitFor time.Duration, tick time.Duration) bool

func RandomBytes

func RandomBytes(len int) []byte

func RandomString added in v0.2.0

func RandomString(len int) string

func RandomUint32

func RandomUint32() uint32

func TryTilCountIs

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

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