testutils

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0, UNKNOWN, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdoutAndStderr

func CaptureStdoutAndStderr() func() (string, error)

CaptureStdoutAndStderr temporarily pipes os.Stdout and os.Stderr into a buffer. Imported from https://github.com/moul/u/blob/master/io.go.

func FilterStability

func FilterStability(t *testing.T, mode StabilityMode)

func MutateByteSlice

func MutateByteSlice(bytez []byte) []byte

Contract: !bytes.Equal(input, output) && len(input) >= len(output) TODO: keep output size the same; search all usage first.

func NewTestCaseDir

func NewTestCaseDir(t *testing.T) (string, func())

NewTestCaseDir creates a new temporary directory for a test case. Returns the directory path and a cleanup function.

func NewTestFile

func NewTestFile(t *testing.T) (*os.File, func())

NewTestFile creates a new temporary file for a test case

Types

type StabilityMode

type StabilityMode string
const (
	Stable StabilityMode = "stable"
	Flappy StabilityMode = "flappy"
	Broken StabilityMode = "broken"
)

Jump to

Keyboard shortcuts

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