testutil

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RaceEnabled = false

RaceEnabled is true when -race flag is provided to the go tool. This const might be used in tests to skip some cases as the race detector may increase memory usage 5-10x and execution time by 2-20x. That might causes problems on Travis. Please, use this flag sparingly and keep your unit tests as light on resources as possible.

Variables

This section is empty.

Functions

func CheckTag

func CheckTag(t *testing.T, tag *chunk.Tag, split, stored, seen, total int64)

CheckTag checks the first tag in the api struct to be in a certain state

func RandomBytes

func RandomBytes(seed, length int) []byte

RandomBytes returns pseudo-random deterministic result because test fails must be reproducible

func RandomReader

func RandomReader(seed, length int) *bytes.Reader

func TempFileWithContent

func TempFileWithContent(t *testing.T, content string) string

TempFileWithContent is a helper function that creates a temp file that contains the following string content then closes the file handle it returns the complete file path

Types

This section is empty.

Jump to

Keyboard shortcuts

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