testutils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTryAgain = errors.New("try again")

Functions

func MkdirTemp

func MkdirTemp(t *testing.T) string

func RandData

func RandData(rng *mrand.Rand, size int) []byte

func RandTime

func RandTime(rng *mrand.Rand) time.Time

func RemoveArbitraryFiles

func RemoveArbitraryFiles(rng *mrand.Rand, rootdirname string) error

func RetryCopy

func RetryCopy(rng *mrand.Rand, w io.Writer, r io.Reader) (int64, error)

func Rng

func Rng(t *testing.T) *mrand.Rand

Types

type Checksum

type Checksum []byte

func TarSlurp

func TarSlurp(rootdirname string) (Checksum, error)

func (Checksum) Equal

func (cs Checksum) Equal(other Checksum) bool

type SmallPReader

type SmallPReader struct {
	Rng *mrand.Rand
	io.Reader
}

SmallPReader reads with a small p.

func (*SmallPReader) Read

func (spr *SmallPReader) Read(p []byte) (int, error)

type UnreliableWriter

type UnreliableWriter struct {
	Rng *mrand.Rand
	io.Writer
	// contains filtered or unexported fields
}

func (*UnreliableWriter) Failed

func (uw *UnreliableWriter) Failed() int

func (*UnreliableWriter) Fix

func (uw *UnreliableWriter) Fix()

func (*UnreliableWriter) Write

func (uw *UnreliableWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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